You are right...but the Supreme Court has always upheld that standard, particularly in the case of Lincoln’s suspension of the writ circa 1862, which was struck down on those grounds
nevertheless, the minimum standard for suspension of the writ(rebellion or invasion) has not been met since the US Civil War
The Supreme Court has never ruled that the president cannot suspend habeas corpus. What I believe you are thinking of is the 1865 case of Ex Parte Milligan, where the court limited the circumstances where habeas corpus could be suspended regardless of who suspended it. Specifically, the court ruled that where local and district courts operate freely and openly then the writ cannot be suspended regardless of whether other parts of the country are in rebellion or have been invaded.