If the Navy training is anything close to Air Force training, then only the enlisted are required to qualify on the M4/M16 platform. Officers only qualify using a pistol (in my case, revolver -- 1980s).
The exception was if the officer was in a job that required rifle proficiency, such as MP/SP.
Air Force and Navy are not normally on the front lines, so officers aren't usually carrying long guns.
I have a feeling this plays into the commander's lack of familiarity with the weapon.
Many people think that all members of the military are the SF/SFDDS they see on TV and movies. There are many MOS's that aren't required to shoot, which means they aren't familiar or very proficient with a weapon after leaving basic. Same goes with being in physical shape and other stuff. Which is why I replied the way I did to EEF. In this case, the commander is the leader and shouldn't be handling a weapon at all, due to him leading. Jocko Wilink (ret SEAL) has a story (O4), if he's holding security at a corner, within seconds, one of his guys will take over so he can do leadership stuff. The point is that his guys know he's the leader and shouldn't be holding security.
Another running joke is: How often do you see an O6 doing PT? No one questions him about it either. WO's are on a diff level though.
This brings me to a speculation that this ships captain isn't well liked. Because no one corrected him prior to the photo. "Screw him, let him look stupid".