Physicians who are public employees (coroners, medical examiners, pathologists, etc.) don’t get extra pay for court time, IME.
Physicians who aren’t public employees but are hired as expert witnesses get paid whatever they agree to be paid for their work on the case. Dr. Jones will get a flat fee for his entire service, regardless of the time it takes, while Dr. Smith may insist on getting an hourly fee and is paid based on how much time she puts in (reviewing medical reports in the office, sitting in a courthouse hallway waiting to be called to the witness stand, and actually testifying). Smart and ethical docs will make it clear, up front, that their conclusions aren’t for sale - “If you hire me, counsel, I’ll review the documents but I won’t commit to saying just what you want me to say.” This also enhances their credibility with the jury, as with the doctor who can truthfully say he testifies sometimes for plaintiffs, sometimes for defendants in medmal cases.
Funds and time permitting, though, a lawyer can always find a doctor somewhere who agrees with his client.