I'm hoping there's a reason, because I keep forgetting which goes which way.
I'm quite curious too, on why "some day" always means future while "the other day" past in English, but that's another matter.
Actually, it's not prohibited to use 近年 for future and 近日 for past in theory, but also customary to mean the other way, as overwhelmingly supported by actual usage. Similar words like 最近 or 近頃 usually stand for recent past, so 近日 is some kind of one odd out among them.
According to Yamagiwa (2014):
The "recent" sense of 最近 came into common use on ca. 1910.
The period when the past sense of 近日 declined and the "recent" sense of 最近 came into use is mostly overlapping.
He thus argues there is a correlation between the meaning shifts of 近日 and 最近; it is either the rise of 最近 made 近日 specific to future, or 近日's loss of past sense was made up by a new definition of 最近.