"Validation error in iCalendar: A calendar object on a CalDAV server MUST NOT have a METHOD property."

I have multiple users experiencing “Unsupported Media Type” errors for some calendar events whenever their CalDAV account syncs (hosted on a remote NextCloud server). This does not happen for all events, and I am not sure why.

The logs show the following:

07:02:41.489|017|   S: PUT https://domainredacted.com/owncloud/remote.php/dav/calendars/user/user-calendar/c12a223e-83a2-4f9f-aab5-4e34d9acaa8d.ics
07:02:41.490|017|   UnsupportedMediaType Unsupported Media Type

and…

07:02:41.490|017|   Content: 
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\UnsupportedMediaType</s:exception>
  <s:message>Validation error in iCalendar: A calendar object on a CalDAV server MUST NOT have a METHOD property.</s:message>
</d:error>

I have done some searching, and I found multiple places which discuss this issue, and it appears to be a davmail issue. For example… at DavMail POP/IMAP/SMTP/Caldav to Exchange / Bugs / #628 DavMail CalDAV adds METHOD-property to iCalendar objects it says “The iCalendar objects returned by DavMail’s CalDAV server contain METHOD-properties, in our case METHOD:PUBLISH. Those are semantically invalid in the context of CalDAV, see Section 4.1 of RFC 4791:”

So where does this problem reside? And what is the solution? And why does it only happen a certain calendar events?

Thank you