We also starting having this issue, I did create a post about this just now Firestore queries with "Raw Mode" return: The code terminated for an unknown reason. Potentially, the memory limit 256 Mibs was breached
Didn't see this post before we created the post of our own