Cast to MyGameInstance is not working after packaging the game

Hello, I don’t know why, but I have developed a saving system for my game and it is not working after packaging the game, it just works inside the UE Project. This is my loading blueprint:

The error that is being printed is the second one. The cast is not working but I have set up that type of game instance at my project settings:

My Unreal Engine version is 4.25.1, anyone knows how to solve it?