How can change in Enthalpy for a reaction be written like this? If a gas expands in a container with constant external pressure then:
$W=-P_{ext}\Delta V$
Instead of $P_{ext}$ if we use $P_{int}$ then we will not get the same value because  $P_{int}$ is constantly decreasing from a certain value until equilibrium is attained, while the change in volume remains the same.
This is the reason why we use $P_{ext}$ here:
$\Delta H= \Delta U +P_{ext} \Delta V$
But then, $\Delta H$ for a reaction is:
$\Delta H= \Delta U +\Delta n_{g}RT$ ($n_{g}$ is for change in number of gaseous moles as the solids and liquids are ignored)
where $PV=nRT$ is used. However, the $P$ in the ideal gas equation is $P_{int}$.
So my question is how can $P_{int}$ be substituted in the place of $P_{ext}$ if the values of work done change when we do so?
Your claim that $\Delta H = \Delta U + P_{ext} \Delta V$ is incorrect. It is only correct when the system is always in mechanical equilibrium with the external pressure, or in other words irreversible expansion against constant pressure. The more general statement is $\Delta H = \Delta U + \Delta (PV) $. Here as you can see even when you compare it with $\Delta H = \Delta U + \Delta n_gRT$ there is no problem as we don't have to replace $P_{in} $ with $P_{ext} $.