You failed to notice that JackPhoenix is simply wrong due to admitted unwillingness to do any real analysis on it.
Again, you have four encounters you can go through in any order. Why can you go through them in any order? An ability such as Passwall might already factor into that - which in turn means not choosing Passwall necessitates a particular ordering.
But why would you not pick Passwall? Maybe because you used Clairvoyance to check which four encounters are present. Of course, using Clairvoyance may be out of your budget for dealing something else. So, the reality where you use Passwall to skip A in favor of doing B, C or D first, may be mutually exclusive with the reality where you use Clairvoyance to determine a better strategy, and both may be mutually exclusive with yet other strategies that would require those spell slots to be used for something else.
That's not a railroad.
And again, a simple mathematical example omits detail, but adding in those details typically adds more variance, not less. If you can, say, use Charm Person to sway the ogres to fight the orcs, or the orcs to fight the ogres, you've added another fork to the game tree. A fight where it's you plus three ogres versus ten orcs, is not the same as the fight with you plus ten orcs versus three ogres. Player choices combine with encounters materials to create new possibilities.
Some combinations may converge on similar outcomes, but the case where all of them converge on the same one is a special solution and the actual advice is about averting that. Focusing on that special solution is hence a strawman.