"According to this study[1], morning exercise might be more helpful; there is no sign that evening exercise disrupts sleep, but it might not help as much either."
One positive effect of morning exercise may sinply lie in the associated tendency towards increased exposure to natural (i.e. more intense) light in the morning hours [I don't have a quote at hand, but Prof. Andrew Huberman speaks about the effects of calibrating one's circadian rhythm by morning light exposure in his YouTube podcast.]
Exercise very close to bed affects many (myself included) as it can take a little while for your increased circulation/elevated core temperature to return to normal. Otherwise a few hours before bed shouldn't be a problem.