When the site is intentionally offline, return HTTP 503 with a Retry-After header and a page that tells users what is happening and when to come back.
RFC 9110 — HTTP Semantics: 503 Service Unavailable
RFC 6585 — Additional HTTP Status Codes: 429 Too Many Requests
Google Search Central — How to deal with planned site downtime