Well, no. The castle doctrine is the same if the substantive standard is the same, whether in the case law or in a statute. A statute will not protect you from being charged if the prosecutor thinks that the elements of the doctrine are not satisfied. The inquiry of the prosecutor is the same: Can I get a conviction? Doesn't matter where the standard is set forth as the instructions for the jury will be the same, regardless of the source of the substantive standard.
And yes, the MD castle doctrine is in the case law. But, self defense is an affirmative defense in all 50 states. I will point out that in MD, unlike, say, Ohio, the person invoking the defense need only introduce "some evidence" on the elements (as little as the testimony of the defendant) and then the burden shifts to the prosecution to prove beyond a reasonable doubt that one or more of the elements of the defense are not satisfied. See, e.g., Redcross v. State, 121 Md.App. 320, 708 A.2d 1154 (1998). In Ohio, in contrast, the burden of proof rests entirely on the person claiming the defense and no burden shifting takes place. See Martin v. Ohio, 480 U.S. 228 (1987) (sustaining the constitutionality of the Ohio practice). The burden of proof is hugely important in a criminal trial. This matters far more in assessing the practical availability of the defense in trial than whether the elements of the defense are laid out in the case law or in a statute. You are perhaps more likely to get charged in MD because *some* MD prosecutors are like that, but, legally, the Maryland practice, as established in the case law, is actually pretty good for defendants before a jury.
One quibble on this. The inquiry of the prosecutor is supposed to be "can I get a conviction" with a yes answer resulting in prosecution. Unfortunately not all prosecutors stick to this ethical guideline--the Zimmerman case being an example--and prosecute to make a political point or for their own aggrandizement. Although all the facts are not in, that appears to be what is going on with the current case of the Air Force NCO. This I guess would be the "some" Maryland prosecutors noted, but it is important to bear in mind that this judgment, to prosecute even when a good faith review suggests that you cannot win a conviction, is at least ethically improper.