Probably not, because Hogwarts is inside the real world and you can enter and leave it at will. If Hogwarts was isekai, then a series about boarding school or going to prison would be isekai.
Almost anything could be called isekai then. If you consider the Joseph Campbell Hero's Journey stuff, then you have the "ordinary world" of the characters then they enter the "special world" where they have to learn the rules that apply to them, then at the end they emerge back to the "ordinary world". This is one of the most common overall plot structures. A good example is The Shire in Lord of the Rings. The Shire is the default "ordinary world" of the Hobbits, and everything else in Middle Earth is the Special World. If we start saying that Hogwarts is isekai because Hogwarts is a hidden location in the real world, then what about for example, Skull Island in the King Kong movies? There are plot elements of isekai that of course are the same as any other "fish out of water" story, but that goes as much for, for example, "Beverley Hills Cop" or Jackie Chan going to the wild west in Shanghai Noon as it does for any isekai.
Yeah, so Harry Potter isn't isekai because a school isn't a world, no matter how much magic there is. And otherwise, isekai would also be so broad as to be useless as as description. It's best that isekai is reserved for describing people transported to alternate dimensions/worlds.
If there are any grey areas / edge-cases, i'd be inclined to pick ones like Edgar Rice Burroughs Mars / Barsoom novels, and the type of ones with a hollow earth and entire races / nations down there that don't connect with the surface.