Setting up CalDav on iPhone sets wrong Account URL

I already opened an Issue on Github for this, but wanted to share:

I noticed an issue causing appointments not be sent when appointment is created on an iPhone. When appointment is created in Nextcloud or in Calendar app on Mac, the invite is sent fine, but not when appointment is created on the iPhone.

After doing some digging I noticed that default Account URL is incorrect.
iPhone sets the following Account URL by default:
https://your.host.name/cloud/remote.php/caldav/principals/user@host.name/

However, when logging into Nextcloud and clicking settings on bottom left, it says to use the following URL for iOS/Mac OS:
https://your.host.name/cloud/remote.php/dav/principals/users/user%40host.name/

After manually setting the Account URL on the iPhone to that of Nextcloud, the invites are working as expected.

I had to also manually fix the Calendar app on a Mac.