That might work if you had a long preparation time, but it isn’t practical as a battle preparation technique, nor as a security measure. When Flitwick first introduces the Fidelius Charm, he explains that you can only learn about the secret from a single person:
“An immensely complex spell,” he said squeakily, “involving the magical concealment of a secret inside a single, living soul. The information is hidden inside the chosen person, or Secret-Keeper, and is henceforth impossible to find – unless, of course, the Secret-Keeper chooses to divulge it.”
— Prisoner of Azkaban, chapter 10, The Marauder's Map
It’s only useful if everybody already inside Hogwarts (including hundreds of students) are within the hidden castle. That makes the Secret-Keeper a bottleneck for your defensive strategy, who are otherwise stuck outside the castle until you can let them in. If the Death Eaters are approaching imminently, suddenly displacing the castle’s population beyond the boundary is a bad idea.
I’m also not convinced this would work. The location of Hogwarts is fairly well-known (in proximity to Hogsmeade) and many Death Eaters have been there before. It’s not an existing secret. Can you use the Fidelius Charm to make them forget the location of the school? As far as I know, the Charm has never been shown to be that powerful in the canon.