I don't think so. Since the error is thrown pretty deep in the codebase, at the DAO level, I doubt we have many options in terms of overriding. For example none of the interceptor pointcuts can go that deep:
https://hapifhir.io/hapi-fhir/docs/interceptors/server_pointcuts.html
Only ideas I have are:
1) Branch HAPI, and try to make a change to not throw an exception and point your starter project dependency to your version of HAPI (just for testing purpose, and can submit a pull request if it works)
2) If you want to get real hacky you can create your own dao class in your project and make sure it has the exact same name + path as the existing one so that maven should use your DAO when it compiles the project. This is a super iffy and hacky approach, I'm not sure it would even work
Hope that made some sense