My org-export project was not working for a while, it only causes an issue with three files, so I was just deleting them before export and then restoring them after. But I have finally taken the time to track down the error and it is coming from my
(require 'org-roam-export) line. When This line is commented out everything works as expected, when it is not commented out I get the following error:
Wrong type argument: characterp, org-element-deferred
I have not been able to determine exactly why this error is occurring, but I have been able to determine that the issue is when an org file has a heading with an ID in the PROPERTY drawer. Files that only have top-level IDs are fine, but if a file has an ID in a heading at any level with an ID in it, it will cause the above error.
I am using Orgmode v9.7 and Emacs v29.1.