It doesn't look like it's been fired, which adds to the mystery. Fired it would go a long ways and could have been a stray round off the base, but unfired and not in a case
makes it a head scratcher for sure.
The 20MM gun I'm familiar with was the Korean War era anti aircraft gun on the ship.
View attachment 1125563
This is a twin barreled 20MM, which was a crew served weapon, there was the gunner, then a first loader on each barrel, plus sailors passing the large magazines of ammo to the gun.
The Navy still uses the 20MM as an anti aircraft gun, only this one is called a vulcun gun, and it's automatic, controlled by a nitrogen cooled computer deep inside the ship.
View attachment 1125567
It's all automatic, it picks up the incoming missile, and spews out 6,000 rounds a minute, with no crew around. If you want more info on 20MM WWII era anti aircraft guns check out this link.
20MM Gun