Optocouplers driving MOSFETs in an inverter
The voltage that controls a MOSFET is NOT the voltage at the gate. It is the voltage difference between the gate and source pins of the MOSFET.

The voltage you are applying to the MOSFET gates are all relative to ground, but the MOSFET does not care what the voltage relative to ground is, and in fact cannot know what the potential at ground is if none of its pins are connected to ground.

R6 and R10 pulling the gate to ground instead of to the source pin are indicative of this lack of understanding and are a good way to exceed the gate-source voltage limits of your MOSFETs.

When you drive a MOSFET that has a load connected between source pin and ground, and apply a gate voltage relative to ground, you get a source follower where the MOSFET's attempts to turn on inherently reduce the gate-source voltage difference due to the voltage rise across the load causing the source pin voltage to rise above ground while the gate voltage stays the same (since it is relative to ground). An equilibrium is found where the source pin "follows" the gate voltage with some offset. It has its uses, but not when you're trying to use the MOSFET as a switch.

This is the reason so-called "high-side gate drivers" exist. These are circuits that take a ground referenced control signal and output a voltage difference between two pins which are connected the MOSFET gate and source pins respectively. That way, the voltage applied to the gate is always a predictable amount relative to the source pin which is the only thing the MOSFET cares about.

Also, this gate driver won't be able to switch fast enough for 20kHz anyways. Pull-downs are just too slow. Consider using the opto to drive a totem-pole consisting of a pair of complimentary, smaller transistors (either BJTs or MOSFETs, possibly both in parallel) which in turn drive the gate. You can use a PNP/PMOS on top with NPN/NMOS on bottom or vice versa. They both have their advantages and disadvantages in this case (lack of shoot through in the small transistors despite being driven off a common gate/base signal being the benefit of the NPN/NMOS on top and PNP/PMOS on the bottom, at the expense of not being able to output the full gate drive supply voltage since they are source/emitter followers).

Of course, power this little totem pole off a supply referenced off the MOSFET source, however you decide to go about it (isolated DC-DC converter, charge pump that floats capacitor charged relative to ground up to the source pin, or bootstrap).