Because there are three kinds of detention: criminal detention, public security detention and judicial custody.
Criminal detention is a punishment that violates the criminal law and does not reach the level of rebellion. The longest is 15 days.
Public security detention is a kind of detention made by the public security bureau in violation of the regulations on public security punishment, and the longest detention is 15 days.
Judicial guardianship is exercised by the court. You won't show up for no reason when the bailiff summons you. You can take it away by force, and those who have a bad attitude can be detained. Judicial custody can be sentenced for disturbing the order in the trial.
In your case, at most, he sues you, the court files a case for you, and then asks you to confront him. As long as you cooperate with the court, you will not be arrested. But you should be prepared to provide evidence to the court to prove that you don't want to pay back the money, but you are really financially nervous and have no money to pay back.
Now that the financial crisis has passed, some countries stipulate that the court shall not detain the person in charge of the enterprise or the main technical personnel without reason, and shall not go to the enterprise to investigate or affect the operation of the enterprise at will, resulting in negative impact.