You don't know what habeas corpus is.
Go look it up.
It is a writ filed with the JUDICIAL BRANCH asking for the JUDICIAL BRANCH to decide if the EXECUTIVE BRANCH has the authority to detain the accused.
Are you suggesting that the accused, being held by the EXECUTIVE BRANCH, look to the EXECUTIVE BRANCH for help?
ha.
Actually, you are correct. But, in Quirin, USSC denied habeas corpus to German saboteurs. Essentially, these persons challenged the power of the President to try them in military court. USSC upheld this power.