LM317 - Voltage regulator
Issues:


The LM7805 ground should be to the voltage source ground
40V - 5V out = 35V you want to drop, at 750mA this is 26.3W, way too much for these regulators even with heatsinking.


If you want 5V, I recommend you use something like a R-78C5.0-1.0/X9, then using a normal LDO to get 3.3V from that assuming that both the 5V and 3.3V load use less than 1A.