They're probably going off the precedent of the case Finders & Keepers Inc v. Losers/Weepers LLC, 478 U.S. 186 (1986)
Joking aside, you are correct. I took a case in art law over the summer on a lark and about 40% of the class was how the legal system deals with Nazi art looting. In the words of my professor "We're going to be untangling this mess for at least the next 100 years."
Beleiving in buried treasure is fun, but even if it's real, we likely don't have the best title to the stuff.
If one were to local a hypothetical lost pirate treasure, that would be an interesting case. Because you'd have to trace it back to...well, whoever they stole it from and, yeah the lawyers would have fun with that assuming they could.
I mean, you'd have to actually find one, because Pirates didn't normally grab big gobs of gold but rather other cargo they could then sell off or use. If they did somehow get ahold of actual "booty", well, sailors are notoriously good at spending the money on Food, Booze and Sex, because spending long periods on a ship tends to encourage blowing your pay quickly once you reach port. It would be shocking if they had any left to bury. I was in the US Navy for a decade. Most of the guys I worked with couldn't hold onto money very long once we reached land. I suspect it's because they tended to wander right off the ship and into the closest bar/brothel.
But there's always fun "What if?" like Captain Avery and whatever he and his crew did with the Munghul treasure fleet spoils(I'm gonna assume they didn't form a pirate colony in Madagascar, as cool as that would be).
And of course, there's always whatever the hell is in the pit at Oak Island....assuming it's not literally a bunch of water and some debris. Or the worlds most convoluted practical joke.