Another lexicographically sortable unique id generator

Hello
I am using your code together with MariaDB v11.8.2 (latest stable version) and MariaDB ODBC v3.2.6 (latest stable version) and when testing writing from 3 different threads (simultaneously), I sometimes get an error (see image below) - at least once in a few minutes.
Each process writes random (1 to 2000 records) records to the database each 3 seconds.. error occur after few minutes or 100000 records (approx.).
Do you have some idea?