Are you serious?
If you really want to start nit picking about procedural issues, then technically, if HK protestors were transferred to mainland jails pending hearing of their case in HK courts because of a lack of space in HK cells, the onus would be on you, the defence, to prove a breech of the law or the perps' rights to prevent the prisoner transfer, not for the authorities to justify that they can transfer prisoners so.
So how about you please expend on what you think, procedurally, would make such a temporary prisoner transfer and holding arrangement illegal or unconstitutional?
I am actually serious because what you are suggesting sets up a structural dislocation of the political landscape and in politics that is a nuclear option. I will lay out the premise of my assertion.
Hong Kong Basic Law sets out certain protection, including :
The freedom of the person of Hong Kong residents shall be inviolable. No Hong Kong resident shall be subjected to arbitrary or unlawful arrest, detention or imprisonment. The procedures for amendments to the Basic Law are laid out in Article 159. Any amendments require the approval of the Chief Executive of HK, two thirds of the Legislative Council of HK members and two thirds of the deputies representing Hong Kong in the NPC.
Let’s set out the scenario that for whatever reason, the HK government decides to round up the lot. They have to be charged within 72 hours or be released. There are not enough jails for temporary detention.
I am not a lawyer but my interpretation is that any lawful detention has to be physically within the territory as governed by the HKSAR administration. You can’t simply move them across to the Mainland. That is unlawful because it is a cross border move and under the one country two systems, it is a different legal jurisdiction. That is why there is such a thing as extradition to facilitate legal transfers between territories. China cannot conduct extradition on them because there is no legal basis to do so unless laws are broken in China while physically in China. You can try amending the Basic Law to cover this (long shot) but under current political scenario, there are insufficient 2/3 majority in LegCo. to pass as this is a very controversial move. I am assuming there are no emergency provisions to do this under Executive power. I seriously doubt you can siphon people off cross border even under emergency powers. This leaves a remaining option of declaring HK’s security under threat because there is a break down in law and order and HK has become unmanageable. It becomes a defence issue which Beijing can then call in the PLA and whatever else they decide. For political cover, such a drastic move requires matching developments like uncontained rioting or total breakdown of law and order.
Your suggestion is expedient but there is a procedural process and legal framework in HK that still rest on the notion of rule of law, transparency and accountability.