' Hello Souroin The sentence above would indeed cause problems. As it stands, the 'discovered' appears to relate to the physician, as the listener will usually assume that the subject of the 'when' subclause is the same as the subject of the main clause. So it implies that the physician should examine the patient after he, the physician, has been incidentally discovered.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.