Note 20 Ultra
Is it possible to recover a database for an app that was deleted from inside the secure folder on this phone running Android 11 after 2 months? The phone uses F2FS and storage was only ever half full
No, deleted files recovery is not something that's possible on F2FS, FBE based devices in general, let alone from inside a secure folder on top of that.
How do police recover deleted chat data from phones if this is the case?
Depends on the device. Deleted chat data doesn't mean deleted database file. Sometimes, depending on the app it's possible to recover from backup, from "the cloud" etc, but not everything can be recovered. Encryption is a problem in general, with FBE limiting it even more.
Is this the case even if the device pin is known, would they not be able to brute force the encryption?