Doctors acting on behalf of the state, like prison doctors, do in fact have qualified immunity. The profession is not the pre-requisite, it's being employed by the state. So it's not as simple as the implication that only police have it.
0. https://www.prisonlegalnews.org/news/1995/dec/15/contract-ph...