Why the replacement of 7812 with R-78E12-0.5, DC/DC makes the circuit not working?
You have a capacitor in the clock pulse wire of 4027. That makes clock pulses slow. There's plenty of time when very small amount of noise can cause unpredictable behaviour. You have a perfect noise generator: The switcher in place of 7812. There's another even weaker point: the undefined inputs of the 2nd 4027. Unconnected CMOS inputs easily catch available noises in the air. If they really are unconnected, you have been lucky until this.

Unfortunately we do not know your wiring. Typically people go where the fence is the lowest if they do not think what pulse circuits demand. Thus there can be more. Add some photos, someone here can be able to see something.

You should have no logic signals which are slowed down with capacitors. All logic signals should be 0 or 1 with as fast transient between the states that the logic family itself usually produces. You should have Schmitt triggers to interpret the slow signals and make exact zeros and ones.