Gagarin learned about the problems with the hatch when the hatch was reopened.
From Roscosmos:
В 7.30 С.П. Королев поинтересовался о самочувствии у Ю.А. Гагарина. Казалось, что все идет согласно графику подготовки второго дня, но вдруг, когда до пуска оставалось несколько десятков минут, случилось непредвиденное. Слессари-монтажники Н.И. Селезнев, В.И. Шаповалов и В.В. Морозов проводили заключительные операции на спускаемом аппарате, закрывали люк. Вдруг отчет: «Нет КП-3! Нет КП-3!». Это В.Е. Стаднюк докладывает В.И. Ярополову из пультовой бункера, что на центральном пульте управления один из трех транспарантов, сигнализирующих о прижиме крышки люка спускаемого аппарата, не горит. Стартовая готовность космического корабля при этом уже не наберется!
At 7.30 S.P. Korolyov asked Gagarin about his health. It seemed that everything was going according to the preparation schedule for the second day, but suddenly, when there were several tens of minutes left before the launch, the unexpected happened. Fitters N.I. Seleznev, V.I. Shapovalov, and V.V. Morozov were performing final operations on the descent vehicle, closing the hatch. Suddenly came the report: “No KP-3! ".Stadnyuk was reporting to Yaropolov from the control room of the bunker that one of the three indicator lamps on the control panel was signaling that the descent vehicle's hatch cover was not shut tight. In this case, the launch readiness of the spacecraft is not achieved!
С.П. Королев принимает решение: открыть люк спускаемого аппарата, найти, устранить неисправность и повторно установить крышку люка. А до пуска остается совсем мало времени.
S.P. Korolyov made a decision to open the hatch of the descent vehicle, find and eliminate the malfunction, and then to re-install the hatch cover. And there was very little time left before the launch.
В этой нештатной ситуации так замелькали моментные ключи слесарей-монтажников, что они сумели открыть и закрыть тридцать замков крышки люка, снова проверить ее на герметичность специальным приспособлением – «присоской» и установить теплозащиту люка. Все с облегчением вздохнули, когда из пультовой по громкой связи услышали доклад В.Е. Стаднюка: «Есть контакт КП-3!».
In this emergency situation, the torque wrenches of the fitters worked so quickly that they were able to open and close thirty locks of the hatch cover, test it again to ensure it was airtight using a special device - a "suction cup" and install the hatch's heat shield. Everyone sighed with relief when from the control room they heard V.E. Stadnyuk's report: "There is KP-3 contact!"
Объявляется 50-минутная готовность, С.П. Королев по связи успокоил Ю.А. Гагарина, что все идет согласно графику.
As 50-minute readiness was announced, S.P. Korolev on the comm assured Yu.A. Gagarin that everything was going according to schedule.
https://www.roscosmos.ru/22011/
From TASS:
Утро 12 апреля 1961 года, космодром Байконур. Предстартовая подготовка. После посадки Юрия Гагарина в корабль "Восток" и закрытия посадочного люка было обнаружено, что один из трех контактов "Люк закрыт" не замкнулся.
Morning of April 12, 1961, Baikonur cosmodrome. Prelaunch preparation. After the seating of Yuri Gagarin in the Vostok ship and the closing of the landing hatch, it was discovered that one of the three "Hatch closed" contacts had not closed.
Состояние этого контакта было принципиально важным: за счет его срабатывания на спуске после отстрела крышки люка должен был запускаться таймер катапультирования космонавта. По указанию генерального конструктора Сергея Королева люк был открыт, контакт поправлен, а люк закрыт заново.
The state of this contact was fundamentally important: due to its triggering on the descent, after the hatch cover had been shot off, the cosmonaut's ejection timer was supposed to start. At the direction of General Designer Sergei Korolev, the hatch was opened, the contact was adjusted, and the hatch was closed again.
"Слышал, как его закрывают, как стучат ключами. Потом начинают люк вновь открывать. Смотрю, люк сняли. Понял, что-нибудь не в порядке. Мне Сергей Павлович (Королев. — Прим. ТАСС) говорит: "Вы не волнуйтесь, один контакт почему-то не прижимается. Все будет нормально". Расчетом скоро были переставлены платы, на которых установлены концевые выключатели. Все подправили и закрыли крышку люка", — доложил на Госкомиссии после полета Гагарин.
Gagarin reported to the State Commission after the flight:
"I heard them closing it, the tapping of their wrenches. Then they start to open the hatch again. I looked, the hatch was off. I understood that something was wrong. Sergei Pavlovich (Korolev. - TASS comment) says to me: "Don't worry, for some reason one contact is not getting pressed. Everything will be fine. "Appropriate adjustments were soon made to the position of the boards on which the limit switches were installed. Everyone tweaked and closed the hatch cover."
https://tass.ru/kosmos/4173572