Help! My engine is shutting down in the plane

I recently started using this simulator. Everything was fine for a while. I earned my first pilot license in career mode and started flying. Suddenly, the engine started shutting down on its own. During flight and before takeoff. At random times.
(Cessna 172 Skyhawk). The fuel mixture stick would extend on its own. The screen displayed messages about low oil pressure and other warnings regarding electrical power and vacuum.
I can restart the engine, but it will eventually shut down. The question is, why did the engine suddenly start shutting down in flight, and what caused the error? How can I fix it?
I fly a Cessna 172. I use VR goggles and a Logitech X52 Professional HOTAS headset.

If the mixture lever is moving to cutoff on its own, this is shutting down the engine. Usually this happens if you have a button or axis assigned to one of the mixture controls unexpectedly. Check all of your peripheral key binds for something that could be causing this.