This error only shows that sync was problematic, most likely due to some file disk storage problems on one of the hosts. I dropped the whole sqlite and started again but it still happens. Regardles of original source of this problem, I can't really debug what values are there now. Can we update the error to show id of note being inserted ?
That's not a storage issue but some problem with your data. Note IDs are globally unique so in theory it's not possible to hit a unique constraint, unless there's a script or something that creates notes with a static ID.
Do you use any plugin or external app that's connected to Joplin?