Even if you reload the game there is nothing stopping you from getting to the switch with the red marking above it and flipping it as many times as you need to to open the main gate to the palace. I have done it countless times. I wouldn't just softlock the player like that, unless this is some completely new bug that I've never seen before.