9V Vin powered Mega - 3V instead of 5V
So, according to the comments the main problem should be a thermal protection in LM7809C regulator.

The voltage drop between regulator's input and output is about 15 Volts and even with current consumption about 150mA it means 2.25W of power dissipation on it.

For such a big difference between input and output voltage switching regulator is recommended. (Or 9V power supply instead of 24V)

And it is not possible to have 2mA current consumption. I've just measured power consumption of bare Arduino Mega 2560 and it is 81mA through barrel jack input (9V) without anything on it. Not even blinking Led. So if you've measured for example 0.2A it's not 2mA but 200mA