I haven’t done this, but last year travelled through Prague twice - a few days there before a QR trip via DOH, and an overnight before returning to the UK.
As far as I can remember, security was done at the gate in both cases. So you should be able to change from one gate to another without any problems.