I've resolved my issue, that produced the very same error message by updating a dependency:
I use esp32-wifi-manager, originally from https://github.com/tonyp7/esp32-wifi-manager, which doesn't seem to be maintained any more and isn't compatible with idf 5.
I changed my version to https://github.com/huardti/esp32-wifi-manager, now the inlclude works. So, maybe one of your dependencies is causing the problem.