Solar panel powered regulated output voltage collapses after short run-time
0.9&#8239;A through an L7812 feeding from 24&#8239;V gives a loss of (24-12)*0.9 = 10.8&#8239;W.

All of this will be converted to heat in your small package (presumably TO-220 or some variant thereof), and this is a lot. It will get very hot, and then it will shut down as to protect itself from self destruction.

Your fan is not 3&#8239;mA, it is 300&#8239;mA. This is less than 900&#8239;mA but still a lot of power.

It is possible that you can attach a big heat sink to the L7812 and make this work, but a better option is to buy a cheap switch-mode converter.