Black screen during interaction with page

ionic/react : “5.6.8”
ionic/react-router: “5.6.9”
react: “17.0.2”
next: “11.0.1”
Hi, I am facing issues with black screen and components losing its styling during interaction with a page. It happens usually when I am clicking on the buttons which call some popups which are ionic components. I am pretty sure it is also connected with routing. This little css property is called during those events. I can of course block this css in the code, but it is pointless because when I set it to transparent I see that components lost its styling, also I cannot interact with the page. I see that Ionic 6 probably resolves those issues, because after migration I did not face any issues, but I cannot be sure, because many things just crashed and I would have to upgrade them to test it fully. Unfortunately it is quite impossible to migrate our app to ionic 6 right now because there is no enough time and there is no guarantee that everything will be fine.
Is there anyone who faced those issues and could help me to solve this problem? Please help.

create demo project in stack blitz and see if you can replicate your issue so we can take a look.