I am facing a problem while designing a Schmitt trigger circuit
The LM339 has an open-collector output stage, which makes it's high state output value dependent on many things - none of which are the LM339 itself.
When the output is supposed to be high, the voltage level is dependent on VDD5B, R6, R7, R8, R9, the input voltage OUTB and its source impedance, and whatever OUT2 is connected to, its bias point voltage, and its impedance.  As long as all of those details are secret, so is the reason the waveform top is not flat.
For example, if the waveform peak value is 4.5 V, then 167 uA of current is going somewhere.  It cannot be going through R7, because that would create a 50 V voltage crop across the resistor.  However, if whatever OUT2 goes to is held at approx. 2.8 V with a zero ohm source impedance, that would explain the output not being the full 5.0 V.
Disconnect R9 and see what the pin 1 waveform looks like.
Note - your schematic does not show the power supply rails for U1 or any power supply decoupling.  These are important for proper operation.