So I found their discord yesterday and I found out this is super common glitch that happens in this gym. If you leave and come back the puzzle resets and that one door CANNOT open. Meaning, short of opening up the game in RMXP and mapping around it, you cannot progress in the game further until there is a big fix for this.
From the Pokemon Solar Light and Lunar Dark Discord:
- In the 4th gym, there's a door that can be used ONLY ONCE : that means after you pass this door, you can't go back until you defeat the Gym Leader. There's a bug that keeps this door closed when you do the gym a second time and if you haven't defeated the Gym Leader you won't be able to make progress in the game anymore.
So Tl;Dr: We and anyone who tripped this up cannot play this game anymore.