Making an educated guess here, but the choice to use 24 volts AC for HVAC control - given the era of when that decision was made … which Im thinking was probably just before the transistor was invented … would have been the right choice since 24 VAC has been a common voltage for driving relays and even starting motors… it’s much more resilient to wire oxidation and when it comes to moving electricity over long distances, AC is the optimal choice by far since I2R losses are significantly lower in AC than with DC and those control wires - depending on the size of the house or the industrial building could be a substantially long run of wire … obviously with todays electronics, even a low 3 volt DC line over twisted pair would be ideal … but were still dealing with technology that started taking a foot hold back in the 40s and 50s and theres still a ton of it out there…
I’m not sure I agree with you on the whole chopping into the device to find its 5 volt pickup on the circuit board … power supplies tend to be a balance point in a circuit for overall current flow and in the elimination of transient current and voltage spikes which are normally handled in the power supply portion of the circuit. It would be much safer to use an external 24V AC source to power the unit if it cannot be powered from the existing wire … its always best practice to keep a device running as it was designed to run rather than hacking inside it and bypassing what the engineer did… thats more of a spit and duct tape approach and has a much higher risk in terms of causing damage (or fires as you pointed out). If you can learn which two pins need the 24 VAC to power … then using a simple 110 to 24 VAC wall adapter would be the safest way … assuming it cannot be powered by the means that the manufacturer is wanting it to be powered.
Also wanted to comment on what you said about a ground wire … with AC … ground is not your return … your return as I’m sure you know … is the other lead on the transformer that is providing the voltage in the first place. Alternating Current taps off of a transformer and earth ground is only used in AC circuits with appliances to keep them electrically protected so that if one of the AC wires inside the appliance should happen to get loose and touch the chassis … when the chassis is grounded to the earth then if a human touches it, there will already be a path for the electrons to travel to the earth through the chassis ground where if it were not grounded to the earth and a human touched the chassis with the busted wire in it, the electricity would seek the path of least resistance to the earth and it would find it through the person who touched the appliance … so for AC, earth ground is only used for safety, not for the circuit path.
This is not the same for DC … as we can actually use Earth ground in DC as part of a circuits path if we chose to do so … but AC current only flows back and forth from one side of a transformer to the other. In Home AC, one side of the transformer is the black and the “return line” is usually white with green being earth ground but playing no part in the path of electron flow except when something goes wrong.