Fear and claustrophobia are not in-flight issues. From the very beginning of spaceflight, it was recognized that psychological factors would have to play an important role in astronaut selection:
But the critical elements in the selection, they believed, related more to the psychological than to the physical aspects of spaceflight, for “by far the greatest problem involves the implications of a seemingly complete break from the Earth and the protective societal matrix in a small, isolated, closely confined container with few companions.” An astronaut candidate, they believed, must “manifest intense motivation for the project,” have a strong ability to cooperate to the point that they could place trust and confidence in associates and win the trust and confidence of those associates.
And this screening continued throughout astronaut training:
- astronauts spend years training inside spacecraft mockups, any claustrophobia issues will have surfaced before flight.
- Fear is mitigated by training for every possible emergency. During launch, astronauts are calm because they know what to do if anything bad should happen (source: lecture by astronaut André Kuipers).
People who have fear and anxiety issues wash out during training, or conquer their fears.
Early astronauts were selected from the group of test pilots: people that were already selected for their ability to remain calm and function efficiently under stress.
As a result, the Apollo astronauts routinely showed heartrates that ware barely elevated, even in high-stress situations.