You need to discover what “ex parts” means. And the order Taney issued (ex parte) was not issued to Lincoln, it was issued to the Commanding officer at Fort McHenry where Merryman was being held. So in actuality it was that Army officer who told Taney to shove his order where the Confederate sun don’t shine, not Lincoln. ;~))
Its "ex parte" and I'm quite sure I learned that in law school. The executive branch was obligated to respect a ruling by the judicial branch. Since the military is part of the executive branch........