I have this problem where Revit 2020 and 2022 stared crashing when exporting to IFC. I would have never conected this to Enscape but i found this thread about someone having the same problem and mentioning Enscape, so I uninstalled Enscape to test it. IFC export works. Hope you have a fix for this some time soon.
https://github.com/Autodesk/revit-ifc/issues/382
Whenever you encounter any issues with Enscape or your subscription please reach out to our dedicated support team directly through the Help Center or by using the Feedback button as detailed here.