Here's why -
A 37 gallon tank is tall.
A 40 gallon tank is long.
Most fish like horizontal swimming space, therefore you can put less in a taller tank.
With those calculators, more goes in than just tank size and fish. It has a lot of variables. But nothing's perfect.
General rule is - use them to start your stock plan based on what fish you like.
Then, do research on specific species of fish you plan on and make sure they'll be happy together or with the environment you're hopefully planning.
Last, ask an expert, or an experienced aquarist, like some members found here. Sometimes aggression can be an unseen factor between two similar species.
Hope this helped.