Gandalf wasn't in Starfleet. He'd be busted down to Ensign. He wouldn't even be allowed to wear a white uniform. Except on formal dress occasions of course.
Don’t give me that “subspace divergence field” mission debrief nonsense. We all saw him get blown out a hull breach. Whoever that is, it’s not our Kim.