You can not replace your all-fighter planes with 5th Gen fighter planes. There is a reason still USA and others still flying 4 Gen fighters along with 5th Gen.
4th Gen will not be going anywhere before 2050. IAF will be flying HAL Tejas MK1A, Mk2 and TBF.... and hopefully, will fly AMCA before 2035... So will be able to start replacing the 4th Gen fighters before 2050.
About PAF, the most probable that they will fly a Chinese-made 5th fighter with some Modifications with a different name similar to already inducted other military types of equipment.
LOL of course they will not grounded those thousands fighters as those planes are still useful in the environment where not many Fifth gen fighters are operated by most countries. You also dont grounded fighters like F 16 and F15 that can still operate as they can be used for bombing mission after all of the enemy SAM system and Air Force is eliminated by fifth gen fighters and cruise missiles.
They also can be used to challenge another 4 generation fighters plane and also for patrol or catching civilian planes within their air space until their lifespan is over. Any way the induction of F15 EX has more economic tendency than military ones as Boeing has financial difficulties and needs to be helped.
Any way under US new administration, they are not willing to induct F15 EX more than the ones that have already been ordered during Trump administration. Trump administration is also very economic centric one.
Future is 5 generation planes and USA keeps producing 5 gen planes whether fighters or bombers