Here I can think of two possibilities:
- The tolerance is too loose, and we can consider setting tighter ones.
- The option "Optimize All (DLS)" is selected, OpticStudio will execute one cycle of the Orthogonal Decent algorithm then execute the Damped Least Squares algorithm. And this one cycle of optimization could lead to the ray tracing failure. To avoid the first OD optimization, it could be done by loading the merit function in user script and optimize.
The commands are LOADMERIT and OPTIMIZE n. (mentioned in The Tolerance Tab » Tolerancing Overview » Using Tolerance Scripts » The Tolerance Script Commands)