I won’t give names or location, but a friend did an experiment several years back along this line. Here’s what he did:
He vacuum packed (same food saver bags) an older handgun plus some ammo (9mm, if I remember correctly), then sunk it in the cove near his old cabin.
After a year, he fished out the bag, cut bags open, and loaded the handgun - and it went bang as it should have. I don’t believe he put any silica in, though not a bad idea if it might be buried longer.
I’ve seen ammo stored in various versions of military ammo cans with varying success - usually, the genuine mil-surp cans held up the best to being buried. I would imagine vacuum sealing a handgun and ammo, putting in such a box, and buring might work well (though easily found via metal detector).
The local Mormon pantry will can ammo in cans of any size you want for very little money. Cheaper than an military ammo box.
Metal detectors are easily spoofed by random placement of junk in the yard. Imagine barn area or an equipment shed. Only ground penetrating radar looking in exactly the right spot would find a cache.