Raspberry hangs sporadically after turning monitor on/off

Hello,
I build a Magic Mirror with my Raspberry PI. Everything works fine.

But sometimes (every 1-2 days), the Raspberry hangs after he turned on or off the monitor.

At first i used this commands:
sudo vcgencmd display_power 1
sudo vcgencmd display_power 0

=> Result: Sometimes the Monitor freezed. (even if i killed the magic mirror application via ssh, the monitor was freezed).
Really really bad was the fact, that i can’t reboot the raspberry via ssh. when i try “sudo reboot”, the raspberry looses the wifi connection, but doesn’t reboot. => not usable any longer.

Then i tried this commands:
tvservice --preferred
tvservice --off

But here, sometimes, the tvservice hangs after 1-2 days. i can’t control the monitor any longer.
“tvservice --status” hangs also, and doesn’t get more informations.

With the tvservice commands i can reboot my system, but reboot every day, is not really cool.

Does someone have an idea? i already switched the power supply, but nothing changed.
and i’m sure, that it happens always 2-3 seconds after the monitor turning on or off.