How you got here is worth understanding so it does not repeat: the replica is running on a host with a different operating system version from the source.
That is extremely common when building a new replica on newer hardware or a newer base image, and it is one of the standard traps in database migration. The data files came from a machine with one locale library and are now being read by a machine with another.
Two ways to avoid it in future:
Match the operating system version between primary and replicas, and upgrade them together deliberately rather than incidentally.
Use a collation provider that versions independently of the operating system, which recent PostgreSQL versions support. That decouples sort order from whatever the host happens to ship and is the more durable answer for anything long-lived.