Shutdown instead of restart

I have a Thinkstation P310 desktop computer. The problem is that sometimes clicking the restart button shuts down the machine completely instead of restarting. What can cause this error? I experience the same thing in several distributions, all of which have in common that it happens on Xfce desktop.

Hi do you have any error logs that you can provide before it shuts down?

Restart is triggered by the following command:

xfce4-session-logout --reboot

Could you check running it in the terminal? It should close everything and restart the computer.

Yes, this command works. Otherwise, this error occurs randomly, so it is not so disturbing.