Connecting two DC converter's inputs in series
The problem is what happens if your two devices want to draw different amounts of current. The feedback mechanism in their internal power regulators makes things more complicated, but it very likely leads to things not working well at all. One device might end up getting the whole 40 V and the other getting nothing, the system might oscillate, etc.

A simpler solution is get just one 24 V AC-DC converter, and connect the two devices to it in parallel.