Reagan’s mental health and age were an issue all the way back to his first presidential campaign. There were many who claimed that Reagan was too old to be president and that his mind was not up to the task, especially during his re-election campaign in 1984. Reagan famously countered those with things like “I will not make age an issue of this campaign. I am not going to exploit, for political purposes, my opponent’s youth and inexperience.” Reagan’s charisma and sharp-witted comments tended to counter any attacks on his mental health.
While the issue did come up during Iran Contra, a lot of folks at the time brushed it off as the President trying to have plausible deniability. This was supported by things like vice-admiral Poindexter testifying that he intentionally did not take certain things to Reagan specifically to insulate him and to protect him from any potential future repercussions.
You can see in this SNL skit from that era that comedians were making fun of Reagan acting a bit clueless at times. The issue was out there all throughout his presidency.
There’s a big difference between people making fun of Reagan’s bumbling and people seriously accusing him of having dementia though. And, while Reagan could be a bit bumbling, he was also very quick-witted (“Honey, I forgot to duck”, for example).
As the OP notes, after Reagan’s presidency and his later diagnosis of dementia, people started looking back on things like Iran Contra and thought that perhaps Reagan really was as forgetful as he had been saying, and perhaps it hadn’t all been political deniability after all.
Even today there is some debate about exactly when Reagan’s dementia symptoms started to become significant. Reagan’s physicians went on record saying that he showed no signs of dementia at all during his presidency. Reagan’s own son Ron claimed that Reagan was starting to have symptoms as far back as his initial presidential election (which Ron later retracted somewhat). Michael Reagan on the other hand has vehemently disagreed with this. And so the debate rages on.