Exercise before bed


I have a FitBit that tracks my sleep cycle. I found that when I exercise right before bed for about 20minutes without sweating too much, I sleep much better through the night (more deep sleep) compared to a regular night. However, some people advised me to avoid exercise three hours before bed, I’m not sure what their reason was but they were adamant on it. Any advice?