How to calculate energy gap when determining electron configuration? The weird electron configuration of Niobium was well explained on this post:

How can one explain Niobium’s weird electronic configuration?

It was pointed out that electrons fill orbitals with higher exchange energy and lower repulsion energy, only if the sum of the positive exchange energy and negative repulsion energy overcomes the energy gap between orbitals.

The only problem is that I do not know how to quantify the energy gap.

How can I calculate the energy gap between orbitals?
You could calculate the energy of your initial electron configuration, then do the same for your final state and work out the difference. The Los Alamos Flexible Atomic Code (https://github.com/flexible-atomic-code/fac) can do that for you. There should be no state where you fill shells from the ground up that has a lower energy than what we now call the ground state of nobium.