I’m not an electrical engineer but…
The issue you’re having is because you’re using a linear power regulator. When you drop the voltage from X to 12, the device is going to dissipate (i.e., shed as heat) power calculated like this:
PowerIn = VoltageIn x CurrentIn
PowerOut = VoltageOut x CurrentOut
PowerDissipated = PowerIn - PowerOut
For purposes of figuring out dissipated power, you can call CurrentIn and CurrentOut equal, giving you:
PowerDissipated = (VoltageIn - VoltageOut) x Current
In your case, this results in:
PowerDissipated = (32 - 12) x 1.5 = 30 Watts. That is a TON of heat for such a tiny device to dump. You are probably triggering some thermal shutdown stuff inside the part.
A linear regulator isn’t the best part for this task. You want to be looking at DC/DC Converters like those made by Traco and similar. You want a switching regulator (as opposed to linear).
I’m sure folks more knowledgeable than I will chime in and offer more suggestions. One that comes to mind is slapping a high wattage resistor between the power source and the input to the 7812. But you have a pretty high input voltage range so that might hurt you on the low end and/or not fix things on the high end.