If a person bound by recognisance, or served with a subpoena, to attend as a witness in any court at a trial, who has failed to appear when called in open court, either at the trial, or on the day appointed for the trial, has been captured under a warrant issued by the court, bail may be taken before any magistrate for his or her appearance at the trial.