Limitations of Large Language Models in Clinical Problem-Solving Arising from Inflexible Reasoning