Hello,
First I was thinking Mautic cannot assign the next available ID. But then you should get a 500 error rather. This behaviour is super weird.
Is this docker? @mzagmajster what do you think?
Hmm, that is interesting. It looks like something might be wrong on web server level (apache, nginx, etc.).
I would look into the request that is made to the server (network tab in browser). In addition to mautic log I would also look into web server logs (access and error).
I would also reset the permissions on the filesystem. Cache folder needs to be writable by the web server user.