I think what you are trying to achieve is having a loading screen between loading the levels(scenes) and you want to persist the state of this script on to the next level.
So i’m going to tell you of another way to achieve this goal.
Store the number of the level you are trying to load in a script on a game object in a scene
Add the DontDestoryOnLoad(this) for this game object. This would keep the game object when you load the new scene.
Load the loading screen scene
The loading screen scene will now have access to the game object we passed through from step 2
Now you can access the level number that we stored in step 1 and load the next level
Before you load, make sure to Destory the game object that stores the next level value so that we don’t have duplicates when we load the later levels.
I confirm that this works because I use it to load the levels in my game.