Let's say your house abuts a public park, providing access to an area that's hard to reach from the public entrance. You let kids walk down your driveway and through your back yard to the park. You frequently sit on the porch and wave to them as they walk through. On busy days, you sell parking in your front yard to park-goers. One day, after 50 years, you decide you don't like those kids walking though your yard any more and you lock the gate. Or, to tailor the analogy more closely, the Simpsons' Mr. Burns buys your house and locks the gate.
If someone took you (or the new owner) to court to re-open the gate, you'd probably lose.
That's incorrect! Routine use of a path over your property over a large amount of time is a classic case where a public easement is created without the owner's consent. See "Prescriptive Easements"[1]. You absolutely will be required to re-open the path.
There was a post on /r/legaladvice where someone's neighbor sold a plot of land, causing them to effectively be landlocked, but there was a road through OP's land connected to the seller's property with a locked gate to which the seller was demanding access. Basically everyone was telling OP not to allow the seller access, even once, as that would set a precedent.
If someone took you (or the new owner) to court to re-open the gate, you'd probably lose.