It would be great to run the sync only if you are in a particular network. The restriction could be based on the WLAN SSID or the IP address. Alternatively, you could test the availability of the target CALDAV Sync Server. In environments where the server can only be reached in the company subnet, the sync could be used without constant error messages. That would be great!
DAVdroid for Android uses the SSID for a similar function. Here is an example of how it was solved in DAVdroid: new setting: only sync in specific WiFI (by SSID)
I have already created this feature request in the Github repository.