The following bug has been logged on the website:
Bug reference: 17496
Logged by: Yankz
Email address: qubzen(at)gmail(dot)com
PostgreSQL version: 13.7
Operating system: Mac Os
Description:
to_char function resets if interval exceeds 23 hours 59 minutes found at:
https://www.postgresql.org/docs/current/functions-formatting.html#FUNCTIONS-FORMATTING-TABLE
Tested for both 13 and 14 versions. Check here:
https://dbfiddle.uk/?rdbms=postgres_14&fiddle=31f5d8b7e8dbf855e1907e6e8f01d5cf