Does time.sleep() can cause segmentation fault :11 error in MacOS?

Hello, I adopted a time.sleep(0.3) code to integrate pyxid StimTracker control in the PsychoPy experiment.

Since the experiment uses audio stimuli, I first suspected pyo or sounddevice, but even psychtoolbox backend cause same crash RANDOMELY, in the RANDOM POINT of the experiment.

So, I checked the whole code, and suspect that, maybe time.sleep code cause the crash, since core.wait also calls time package, and use it.

The experiment is ran in MacOS 13.5 and tested with many PsychoPy package versions but all shows same RANDOM crash.
Also, I tested same code in freshly installed macOS with minimal install, but faced to same result.
Anybody experienced Segmentation Fault :11 crash with calling time.sleep in inappropriate position of the code?