Chief Psychiatrist positions for CDCR (the california prison system) top out at around 363k for a standard work week salaried positions. For "senior" psychiatrists the salary is about 340k currently. decent benefits but the pension is not as good as it used to be for people who have been there before the state changed the pensionable compensation.
There are many agencies that contract with the prison system to provide locums (can't be done directly) and depending on the agency, the location of the prison (the more remote the higher the pay - though the most remote are maximum security facilities and pretty scary), and the type of work ("inpatient" pays more than "outpatient" level care). Rates range from $200/hr-325/hr). At the higher rates you can certainly earn in excess of 500k (possibly even closer to 600k), but it is a bit misleading to say this is the pay, since it is hourly independent contract work and not an employed salaried position. Malpractice is included. No benefits and you have to include the lack of paid vacation and sick leave in your calculations and the number of hours worked. Remember to include the cost of benefits (retirement, disability, health insurance etc), sick leave, vacation, holidays etc, when comparing salaried vs IC. As pensions die off and with the trump tax changes, IC work more often comes out better than salaried even for many physicians.
There are huge variations in prisons. In california there has been some disquiet that psychologists have been taking a leading role and subordinating psychiatrists. This came about because of recruitment issues and has exacerbated them. working in government facilities, total institutions, and correctional settings come with challenges. Working in a prison is antithetical to healthcare and the aims of the physician may be at odds with the facility. The positions with the hardest to fill positions may have a lot of work as a result or inability to meet demands and provide adequate care. The reality sadly is that the standard of care in prisons is much lower and the supreme court has ruled that medical care in prison need not meet the community standard but merely not be "deliberately indifferent."
On the flip side, prisons have become warehouses for chronically seriously mental ill individuals and those who want to care for the most truly disenfranchised can find their calling here. There is a lot of very severe psychopathology (it's not just malingering and personality disorder but yes there is a lot of psychopathy too which is fascinating if that's your jam). If you are interested in sociology (e.g. gangs, officer-inmate relationships, the sociology of institutions), the intersection of mental illness, public health, criminal justice, and law, and like the systems based, mediolegal and ethical dimensions of psychiatric practice there is a lot to sink your teeth into. You could be rapidly promoted to very senior positions because of the desperate need. This could potentially serve as a platform for other leadership/administrative positions. Some prisons are dangerous but many emergency rooms and inpatient psych hospital wards are much more dangerous.