In UE5 begin play won't work

In my UE5 project begin play just suddenly stopped working in the packaged version. I’ve tried everything like changing the packaging configuration, changing the game state and game mode, I even tried making both those classes C++ classes, I also tried migrating to a different project and it still didn’t work.

Thank you.