24V RMS is going to be 34V peak (68V peak to peak). Really shouldn't be able to get any higher than 34V DC. Is the 24VAC really 24VAC?

Is this full wave rectified? How are you getting DC from the 24VAC? How "DC" is the DC?

Have you had a look at any waveforms on a scope? Pics?

Also remember that a zener will clamp and effectively short circuit the input at higher voltages so could end up dissipating quite a bit for long term high input voltage. If the regulator can truly withstand 40V I'd run with just that. There should be enough further headroom above that (and the 5% you have from the 2V gap from 38-40V). I'm not sure how consistent this 24VAC supply should be though.

Also diodes aren't always the greatest for voltage drops since they will vary a bit with current draw particularly with lower currents.

What (brand/part) is the buck regulator? I presume this is a pre built module of some description you are using.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)