Response (mouse) is not recorded/noticed/taken after a specific amount of trials

Hi,

I am programming a behavioural experiment with psychopy. I have objects and a room which I display on every trial. Everything goes smoothly when I for example use 24 trials and 4 blocks. However, when I increase the trial number at one point e.g. 40 trials per block, it stops responding to my mouse click. It does respond to other keys such as pressing space bar to move to the next trial. I have tried garbage collection, unloading, and other things to do with resources and check memory etc. I tried saving data differently. I tried using other versions of psychopy (currently I am using python 3.8 and psychopy 2023.2.2, I have tried 2023.2.3). So far nothing helped to solve the issue. with a smaller number of trials the task runs smoothly. I check and tried all options that ChatGPT 4.0 advised.

any more ideas?