I ran into a similar issue and had to explicitly add -DVTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2=YES
to my CMake line (see post here: https://discourse.vtk.org/t/two-questions-about-new-module-system).
This was unlike with VTK 8.x (which used the old module system), where the RenderingContextOpenGL2
module was brought in transitively through some dependency.