Honestly, what made Deathly Hallows fall apart was mostly not being set at Hogwarts. Like, we can argue about the individual plot beats all we want but more than anything, it really served to show just how much the series needed that central hub to anchor itself and develop its characters and mysteries. Turning it into this country trotting adventure for the last novel was a terrible call.
I thought it was that Rowling had no idea how to conclude a series. There were so many plot threads that needed wrapping up from previous novels. Finding the horcruxes alone was shown to be this monumental task with the pendant alone being protected by layer after layer of obscurity and enchantment, and
it didn't even end up being the real one. Instead of focusing on wrapping up the plot and bringing events to their conclusion she treats 80% of the book like it's just another entry in the series, setting up new mysteries, detailing the humdrum events of the trio faffing around in the woods, and then suddenly near the end of the book she realized that she hadn't actually resolved anything that needed resolving and the characters rush around doing everything that needs doing, while solutions to, previously impossible, problems appear one after another until it suddenly just ends.
I don't think it needed to be set at Hogwarts, the school is great, but there was plenty of benefits to be gained from developing the wider world and necessity for Harry to venture out of his home territory to take the offensive against Voldemort. Rowling just needed to realize how much she actually had left to resolve and spend the book focusing on that rather than trying to change the setting and keep the same plot structure.