@Piotr Janiszewski Thanks for reaching out.
You can run this command in Powershell to turn the sync off.
Set-MsolDirSyncEnabled -EnableDirSync $false
Also do note that, If you use this command, you must wait 72 hours before you can turn directory synchronization back on.
Check the official document here : https://learn.microsoft.com/en-us/microsoft-365/enterprise/turn-off-directory-synchronization?view=o365-worldwide
-----------------------------------------------------------------------------------------------------------------
Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.