https://www.reddit.com/r/(...)at_the_moon_landing/TIL that in the event that the moon landing failed and Neil Armstrong and Buzz Aldrin where stranded, NASA planned to end communication with the men, leaving them to either run out of oxygen or commit suicide with no further earthly contact
comment:
=================
This is not really true the way it is worded. They would have spent days trying to fix the problem and then of course they would have been allowed to say goodbye to their families and friends should that fail.
However, yes, after all of that eventually the plan was to simply sever communications and let them die on their own as there was nothing else that could be done. They didn't want to record their last moments in case they were... unbecoming. They also didn't want to record how the astronauts chose to die. Suicide for example is both technically illegal and carries religious complications
Edit: The legality isn't really the point, there is a stigma and they wanted to ensure privacy for these heroes in their final moments while avoiding the possibility of any negative connotations.