Is your Quality Gate that is applied to the project set to fail if the Security Rating on Overall Code is set to D?
By default, the Quality Gate doesn’t include conditions on Overall Code (only New Code) because we believe that’s where the focus should be. See this interesting post.