If this occurs on GKE Autopilot, see this GCP doc which explains that you need to enable serial port logging either in your organization or project, which can be done by running:
gcloud compute project-info add-metadata \
--metadata serial-port-logging-enable=true