When I update my custom Record__c a trigger runs, and it calls
recalculateFormulas() on the record. This results in the following error:
System.UnexpectedException: Unable to create/update fields: IsDeleted. Please check the security settings of this field and verify that it is read/write for your profile or permission set.
Same thing happens when I update Record__c inside a unit test. The object has several cross-object and non-cross-object formula fields.
Any ideas what's causing this error?