I don’t know your implementation, but the BEAM as a delay to write to the disk of around 2 seconds, even when it returns that its persisted, its not indeed persisted:
You can replicate it with the script I provide in the above post that uses directly File to create a file descriptor and then writes to the disk with IO.binwrite and you will confirm that persistence is only guaranteed after 2 seconds. This can be configured to be zero seconds, but then will affect performance,