Yeah, the pitfall with shaders I had for my previous games is that the object needs to be exactly the same environment too. So what I did was put all our WorldEnvironment and lights into a scene that could load a map. Then loaded a tiny map for the shader compilation.
This page has a few things to keep in mind. https://www.reddit.com/r/godot/comments/osx0f6/my_very_comprehensive_shader_cache_solution/