I should have noticed the files installed under /lib64/cmake/vtk/patches on the rocky9 machine work as updates/additions to the /lib64/cmake/vtk/*.cmake files. After copying them into /lib64/cmake/vtk the find X11 error is gone now when I add any OpenGL2 component to the list of vtk libraries.
/lib64/cmake/vtk/patches % find . -type f -name "*.cmake"
./99/FindHDF5.cmake
./99/FindOpenGL.cmake
./3.13/FindZLIB.cmake
./3.16/FindPostgreSQL.cmake
./3.19/FindJPEG.cmake
./3.19/FindLibArchive.cmake
./3.19/FindSQLite3.cmake
./3.19/FindX11.cmake
./3.20/FindGDAL.cmake
./3.22/FindMPI.cmake
./3.18/FindPython2.cmake
./3.18/FindPython/Support.cmake
./3.18/FindPython3.cmake