Hello, i'm no expert to this but I think it depends on how fast/slow the process for passport renewal. If renewal is fast and can still accommodate within the medical deadline, then I suggest to renew first. If not, then maybe take the medical first then renew after?
In my case, I made sure to...