The notion of a Fermi level doesn't really make sense when the Fermi level would lie inside a gap. Better yet, it just depends on how you define the Fermi level. If your definition is the energy of the highest occupied state then the Fermi level would sit at the bottom of the gap by definition. This is clearly not the definition being used when one says the Fermi level lies in the middle of the gap.
In fact, what does lie in the middle of the gap is the chemical potential, and because the chemical potential of a free gas of electrons is equal to its Fermi level as traditionally defined, one says that the Fermi level of the semiconductor considered is at the center of the gap. However, let me emphasize again that it really just depends on how you define the Fermi level.
If one redefines the Fermi level from "energy of highest occupied state" to "chemical potential" then the Fermi level will lie in the gap in the semiconductor case considered and the Fermi level will sit at the energy of the highest occupied state in the free gas in agreement with the more familiar definition.
As an aside, the Fermi level as defined by the energy of the highest occupied state doesn't quite work at finite temperature because all states have at least some tiny probability of being occupied. This is related to the familiar statement that the Fermi surface of a metal gets blurred on the scale of T (temp) at finite T. Of course, the difference between a mathematically sharp zero temperature Fermi surface and one blurred by temperature effects can be a minor one from a physical point of view.
This may be going to far, but in an interacting Fermi liquid the Fermi energy is also not equal to the energy of the highest occupied state even at zero temperature. Instead, the Fermi energy is defined in terms of a discontinuity in momentum space occupation.