Version conflict, document already exists when putting new documents

For testing+learning purposes I created a new index and add new docs in a loop. I am using a cli tool for this, which I call in a simple shell loop:

while :; do
  ts=$(date --iso-8601=second)
  msg=$(dicepwgen -c 6)
  echo $ts $msg
  esctl doc add -i slio18 "{\"@timestamp\":\"$ts\",\"message\":\"$msg\"}"
  sleep .5
done

When I use a sleep period of 1 second or higher, this runs smoothly. However, if I decrease the delay, occassional version conflict errors occur. Sample output:

2026-05-29T14:12:18+02:00 barracuda flings Wyoming employable torquing imbibes
1780056739
2026-05-29T14:12:19+02:00 hookup Thailand Garcia earthworm mansards Ypsilanti
Error:  failed to create new doc in index slio18: status: 409, failed: [version_conflict_engine_exception], reason: [1780056739]: version conflict, document already exists (current version [1])

Since the cli tool prints the id of the newly created document, I can see, that the error is because the id already exists. In the example above 1780056739 was created and the next run seems to have wanted to use the same id, which then caused the version conflict error.

Here's the underlying API call for creating the docs:

PUT /slio18/_create/1780057770
{
  "@timestamp": "2026-05-29T14:28:21+02:00",
  "message": "orbits sidles lineup electrons bastards risked"
}

pretty simple.

Can tell my anyone why this happens?

Found it, the ID is generated by the tool, which just uses the unix epoch. Of course this overlaps outside the 1 sec window. So, my fault.