Try to disable the « recent contacts » in your nextcloud installation (it is usually there if you installed the mail application, but you can disable it alone and leave the mail app). For some reasons (and from what i’ve seen it is more a nextcloud bug), the presence of this address book causes issues with sfos.
Also, note that what i’ve written earlier is now completely out of date: a lot of things has been improved on contacts management with the 4.x releases.