The right of the defendant to be at liberty pending trial, on bail or otherwise, shall not be impaired because the issue of incompetence to stand trial has been raised, because the defendant has been determined incompetent to stand trial, or because the defendant has been ordered to undergo treatment to render him competent to stand trial, except to the extent authorized by section 1026 for the purpose of an examination or by section 1032 for the purpose of administering a course of treatment.
MCL 330.2036