IMPLICIT_DEPENDS is only supported in CMake for the Unix Makefiles generator and is (essentially) broken even there (technically the target is not supported to be used/seen by any other sub-directories). See recommendation given at https://discourse.cmake.org/t/add-custom-custom-multiple-output-and-multiple-directories/15474/2
The downside is that rootcling (or an additional step) needs to produce this dependency file explicitly.
This would be a solution to #20907
See the relevant/related reports/discussions of the underlying CMake limitations:
https://discourse.cmake.org/t/add-custom-custom-multiple-output-and-multiple-directories/15474
https://gitlab.kitware.com/cmake/cmake/-/issues/27521
https://github.com/pcanal/cmake_custom_command