Both this and the opposite example where the CMO declares the captain unfit but the rest of the crew are still loyal and follow the captain as i I believe actually happened to Janeway.
I also think that any bridge officier ranks above CMO to become captain in an emergency situation. So they would need to discharge all bridge officers and trust that they will all comply in order to become captain themselves.
Both this and the opposite example where the CMO declares the captain unfit but the rest of the crew are still loyal and follow the captain as i I believe actually happened to Janeway.
I also think that any bridge officier ranks above CMO to become captain in an emergency situation. So they would need to discharge all bridge officers and trust that they will all comply in order to become captain themselves.