I just saw the film Dora and the Lost City of Gold, in which there is a somewhat meta running commentary over whether so-called "jungle puzzles", intellectual challenges typically requiring explorers to push the right buttons, pull the right levers, step on the right tiles, make the correct offering to an idol, etc., and that stereotypically guard large caches of treasure in treasure hunting films, actually exist.
Did ancient peoples ever actually guard their treasure behind intellectual puzzles? To be clear, it seems to have been extremely common for treasure to be guarded by security through obscurity solutions, with passages hidden behind fake walls, stuff buried in the middle of nowhere, and decoy artifacts and rooms, but I'm having trouble finding any instances of actual puzzles of the kind that appear in H. Rider Haggard novels, Indiana Jones films, and Dungeons & Dragons adventures, where the original designers seem to have intended that the puzzle be solved at some future time by persons deemed worthy enough by possession of the correct skills or knowledge.
The critical difference between a "puzzle" and ordinary hidden or buried treasure is the apparent intent that a future quest for the items would involve significant intellectual efforts, such as applying knowledge of traditional lore, recognizing obscure grammatical quirks, solving math problems, using lateral thinking skills, applying steganographic analysis, recognizing out-of-place elements (e.g. all these symbols are of animals that lay eggs except this one, so this is the correct lever to pull and none other), and otherwise performing cognitively significant tasks beyond bare memorization. Cases where a treasure was apparently hidden or secured without eye to a puzzle but where the effort was concentrated on making it hard to find and/or especially difficult to penetrate (secured against brute force solutions) don't count. Drilling through 10 meters of rock or searching every tree in a forest for the one that has a symbol carved into it is not a puzzle, but a chore. Having to recognize that a "star chart" is actually a map of a forest with a rectangular->polar coordinate transform and that the tree with the symbol is the one corresponding to the center of the galaxy on the map is a puzzle.
If a puzzle was actually solved in modern times by chance or brute force, but significant evidence exists that it was originally intended to be solved via a puzzle process, that can count. For example, if an ancient tomb on the side of a mountain was accidentally rediscovered when a World War One fighter pilot was shot down near it, but a later generation discovered that a 3000 year-old painting in a nearby downtown temple steganographically encodes hiking directions to the entrance, that counts. Similarly, if 18th century scurvy pirates (arr) encountered an Ancient Greek "push the button that doesn't trigger a trap" wall but decided to bypass it with explosives because they were all illiterate and had minimal knowledge of Greek lore, that would also count as long as sufficient evidence exists to reconstruct what the original puzzle configuration probably was.