Reported in slack: https://mongodb.slack.com/archives/CKW2HG3M0/p1719247803861389
tl;dr: compacting an encrypted Realm, then trying to open it results in a decryption failure: Realm file decryption failed (Decryption failed: page 0 in file of size 20480 failed the HMAC check. Either the encryption key is incorrect or data is corrupted.
This is the .NET test that fails: https://github.com/realm/realm-dotnet/blob/a1ac24b56d61b4f49f7d8d098cef29f0c91b0979/Tests/Realm.Tests/Database/InstanceTests.cs#L328-L354
It's a parameterized test and it fails when encrypt is true regardless of whether we add data to the realm file or not.