Trying to create a collation on Postgres 9.6; a nonsensical error message
I found a workaround: the bug happens only if an earlier attempt to create a collation has failed. After a failure, the bug seems to keep happening until the server process is restarted. So to create the collation, you have to get it right from the start, or restart the process to try again. To restart a Docker container, use

docker restart $DB_CONTAINER_NAME_HERE