Experiment freezes at random points

I am running an experiment from my local computer which uses windows 10. My experiment randomly freezes at random points of the experiment. It’s not happening for all the participants but for some. There is no specific point in the experiment where it gets frozen.

I am using the v2022.1.4 version of psychopy. The same thing happened with previous version as well. I am getting an error message stating that python stopped working.