65% is touch on the high end but I don't think that would be doing it. Do you have females around? This time of year my males are all acting like that, in the evening especially because they smell all the females in season.
Could simply be that the changes make him feel like he isn't at home and he is confused and trying to find his home. If he was kept for 5 years a certain way, and you went and changed where his basking spot is, what type of substrate he has, removed some of his old smells, etc it is probably pretty jarring to him. In the long run, the changes are going to probably help him a lot, but in the short term might be pretty overwhelming and he just needs some time to get used to it.
Was the 40g what he was already in or is that an upgrade from what he had before?