This is unfortunately a bug in the Microsoft DirectX shader compiler (FXC). Having multiple levels of loop nesting can cause the compiler to go into an extremely slow processing path and there is nothing we can do about it. There are couple of workarounds to try though:
1) Add #pragma use_dxc in the shader to force the compilation to use the newer DXC compiler instead. This is not the default compiler atm but can be used for overcoming some of these issues. The shader code might need some tweaking though since DXC can be more strict on some things that FXC just happily took in.
2) Increase the shader compiler timeout value by setting UNITY_SHADER_COMPILER_TASK_TIMEOUT_MINUTES environment variable. The shader compilation should finish eventually. But of course this is not very helpful for iteration type work. I'd suggest using the DXC workaround for iteration and only use this other workaround in the end if using FXC is necessary for the release process.