Instead of jumping straight to the three-dimensional formula, we can build the space diagonal in two stages using plain Pythagoras twice, which also shows why that formula works in the first place.
Both routes agree because $\sqrt{l^2+b^2+h^2}$ is really just Pythagoras applied twice, once across the base and once up through the height.
Let's summarize:
Building the answer in two steps like this is a good check whenever the single formula feels error prone.