Handling Divergent Trajectories in Global Sensitivity Analysis

I am having the following problem in a large parameter space. Let’s say I have two parameters A and B. If I constrain the range of A between 0 and 10 and B between 0 and 5, the sensitivity to A turns out higher. If I do the inverse, sensitivity to B is higher. If I make both of them between 0 and 10, then the solutions to differential equation diverge. I tried putting NaNs to divergent solutions but this impairs the subsequent calculations of sensitivity analysis since the software is not optimized for dealing with NaN values. I can create a minimum working example if needed. Does anybody dealt with a similar problem? I am open for any suggestions.

We probably just need to add an option to drop NaNs.