you need to get the castle key from the blue slime girl first. Then solve the “puzzle” to unlock the door. Then you can head into fight her. Depending on what you’ve done inside the castle, the difficulty will change.
how do I get the blue slime
find her in the shack inside the forest. battle her and win 3 times. You can then bring her back to the lab with you.