I'm suggesting a commercial 5V power supply and a commercial 24 V PS just to prove a point. Tap into the circuit at the proper spots and probably your problems will go away.
Your then left with a few bypass caps and one suggested BW limiting cap. Most of the complaints were power supply related. I'd start there.
I have no idea what the requirements are, but this is the idea:
https://www.automationdirect.com/ad...l power supply&utm_campaign=dc+power+supplies if you don't have a lab supply.
Linear supplies are usually out of favor these says.
Bypass caps are a part of good design, but most of the time they don't break one. An EMI filter may be regulatory and basically prevents the PIC oscillator from radiating into the power line and stuff nearby from getting in.
That transistor didn't look right, but I concentrated on the other stuff.
It wouldn't be so bad if you could say it needs a new power supply, would it?
Other stuff, like surge suppressors add cost, but contribute to reliability and insurance issues. It's one think if my french fries aren't done and quite another if the gas valve sticks.