The story is probably true.
There's a surprisingly large body of research on making octopus tanks more escape-proof, and some of these articles start out with particularly spectacular stories in which octopuses not only escaped from their tanks (this seems to be almost trivial to them), but also returned to their tanks after a successful hunting trip. For instance, Wood & Anderson (2004) write:
Researchers and aquarists have reported octopuses escaping captivity despite
elaborate precautions (Anderson, 1997; Wood, 1994). One of the first papers was by Lee (1875), who reported that Brighton aquarists were puzzled by disappearing lumpfish, until one morning when the octopus was discovered in the lumpfish tank.
The referred anecdote from Lee (1875) is a fascinating read. To quote:
In May 1873, it was found that some young lump-fish (Cyclopterus_lumpus) were mysteriously disappearing from one of the tanks. Almost daily there was a fresh and inexplicable vacancy in the gradually diminishing family circle […].
One morning, however, Mr. Lawler, one of the staff, on going to count our young friends, found an interloper amongst them. "Who put this octopus in No. 27 tank?" he inquired of the keepers. "Octopus, sir? no one! Well, if he ain't bin and got over out of the next tank!" And this was just the fact.
The marauding rascal had occasionally issued from the water in his tank, and clambered up the rocks, and over the wall into the next one; there he had helped himself to a young lump-fish, and, having devoured it, returned demurely to his own quarters by the same route, with well-fed stomach and contented mind.
Another article that reports octopuses who leave their tanks to hunt Asada et al. (2021), who write:
In the 1920s, researchers reported that octopuses kept
in the Zoological Station of Naples moved from their aquarium to a nearby aquarium to hunt lobsters or other prey [5,6], underscoring the difficulty in containing these escape artists.
Unfortunately, I couldn't verify the two references given. [Ref. 5] (Grimpe 1928) was unavailable to me. I was unable to find the referred event in [ref. 6], a 90-page document "Guidelines for the Care and Welfare of Cephalopods in Research" (Fiorito et al. 2015).
Still, given that even recent peer-reviewed publications do not hesitate to repeat variants of the "octopus on a hunting trip" anecdote, while providing references to back the anecdote up, I don't think there's much reason to doubt the story.