My m19 releases all the gas after the first shot. Does anyone have any idea what could cause this?

Clean it, lube it with 30wt shock oil, also lube the release valve, and let us know what happens.

If its not cleaning an lubrication then it may involve any number of parts including the trigger transfer bar, hammer spring, and impact block. If that's the case you may need to send it in for repair.

If there is no seal keeping the pressure in, then the gas releases and does not move the blowback assembly back. If the blockback assembly doesn't go back, it doesn't reset and re-cock the hammer that strikes the gas release valve, meaning all the gas is released in one shot.