The problem is as follows: in order for the part to work correctly, one of the internal nodes needs to pull up to 6V, but the power supply is only 5V. So the internal node will saturate at 4.69V and cannot achieve its 6V desired voltage. The second stage is working correctly, but only sees a difference voltage of 2.96V at its inputs, so its output is 2.96V.