[ at end of this answer, we compare the LM311 with the LM339 (which will function down to GROUND)]
After examining the LM311 datasheet/schematic (from Texas Instruments page 10), here is what occurs:
signal comes to base of PNP level shifter, emitter current set by current source up at +VDD
the emitter of that PNP shifter comes to base of one NPN of a diffpair(A)
the collector of that NPN goes to load resistor, which is biased one_diode_drop below +VDD; this load resistor feeds the base of a 2nd NPN diffpair(B); with signal near ground, the headroom is quite large, so this does not upset the comparision balance.
THE LIMITING FACTOR is the NPN current mirror for tail current for diffpair(A)
SUMMARY: the input voltage is shifted up ONE diode drop, but then enters a stack of transistors (diffpair(A) and its current source) that needs TWO diode drops to function accurately.
Fundamentally that first diffpair/tailcurrent become CUTOFF.
Cutoff is a strong word; if the bipolar has 10mA at 0.8 volts Vbe, then at 0.4 volts the current will be (approximately) [ (0.8 - 0.4) / 0.058 ] = 0.4/0.058 ~~ 6 decades less current.
Again examining the LM311 schematic, if that constant current source (tail current, the first transistor from the lower left) is disrupted, then the base biasing (partly established by the solitary JFET) is disrupted, and the 2nd tail current is also disrupted.
Notice the collector resistors of the 2nd diffpair(B) are IMBALANCED. One is 750 ohms, one is 600 ohms. These two resistors control behavior of the rail_rail high_voltage amplifier, which has a constant_current pulldown and a NPN emitter follower which controlled the base of PNP which is making the crude comparison about "HIGH? LOW?".
There is a CLUE about imbalanced behavior as the Vin approaches -VDD. The imbalanced resistor values (top center) of 750 and 600 ohms are probably attempting to adjust for imbalanced Vbe of the NPN emitter follower and the PNP base connected to that emitter follower.
As the tail currents (constant current transistors, the 2 at very bottom left) are disrupted, voltage drops across 750 and 600 resistors may be the cause of output default behavior.
Regarding modeling in Proteus, I have no opinions.
You could BUILD one of these, using 2N3904 NPNs and 2N2906 PNPs. Just don't try to operate at 50 volts.
Had the LM311 been designed 20 years later, good CMOS devices could have been used; FETs can be fabricated inside WELLS, and the WELLS can be tied to convenient voltages inside the circuit. Some diffpair WELLS are exploited to cause enormous increases in Vthreshold, and that effect allows Pchannel FETS to measure below ground, and allows Nchannel FETs to measure above VDD (this method is called "body effect" where the well/body/tub voltage is NOT same as the Source).
Comparing LM311 to LM339
LM311 has PNP (moves signal UP) followed by 2_diode_drop NPN diffpair + NPN current mirror. This comparator in NOT spec'd to work down to GROUND.
LN339 has PNP DARLINGTON diffpair (uses 4 PNPs) and a current source up at rail.
This comparator is spec'd to work down to GROUND.