Below is my understanding of USNA's process -- however, I am not an official spokesperson. If you have questions, you should consult an official source at the SA or at ROTC, as appropriate.
First, the DODMERB decision is different than a waiver. DODMERB only decides qualification status. That status alone, even if DQ, does not automatically DQ someone from an appointment.
The next step is a medical waiver. Some conditions just aren't going to be waived. Never say never but the odds are minuscule. Things like candidates who have diabetes or have only one kidney. We can debate the semantics in those situations but the fact is that the DQ by DODMERB is really the DQ from being able to serve in the military, even though the waiver denial actually comes from the SA.
Other conditions are waiverable, but there is a limit on the number of candidates who need medical waivers that USNA can admit. USNA must graduate officers who can serve in the unrestricted line -- and many conditions that require a medical waiver will preclude such service. So, at some point, the numbers do catch up with you.
For example, there is a fixed limit on those with color blindness -- I think it's 2% of the class (could be wrong) but the actual number admitted tends to be much lower. Thus, (in a crazy hypothetical) if the top 25 candidates nationwide all happened to be colorblind, some of them would be turned down b/c of their medical condition. The same is true of other conditions that would preclude service in the unrestricted line. Most don't have set limits, but USNA must consider the entire class and ensure a sufficient number on entering can commission URL, knowing that some perfectly qualified candidates upon admission will become NPQ over their four years.
I personally have no idea what the numbers are -- but you can look at recent graduating statistics and see the numbers who went restricted line or staff corps. It's about 5% of the class. Thus, it makes some sense to assume that no more than 5% of the class is admitted with medical conditions that preclude service in the URL.
The timing issue is separate. There are lots of candidates who need waivers and at least some of those aren't in the running for an appointment for various reasons. It doesn't make sense to expend the resources making a waiver determination until USNA decides whether that person is going to get (or is really close to getting) an appointment. So, to be clear, candidates proceed along for some time as if there was NO medical issue. Once an appointment is looming, USNA looks to see if that person needs medical waiver and then the decision is made. I must confess I don't know exactly when in the process this occurs other than it's quite late.
Hope this helps. As noted, it represents my understand of the process. If you have specific questions, please consult an official source.