I have proceeded on my research. I can simulate it from SSMS. Basically, it only happens when we pass the values as parameters. If that is the case, I also get a very long process in SSMS. It seems to be a bug when the OR operator is used between two LIKE operators.