This is actually great logic. If the fetus is a person, then they can't be unjustly incarcerated no matter what the mother does......... It is awesome.
www.theguardian.com

Lawyer argues fetus of jailed pregnant woman is being illegally detained
Florida attorney uses ‘fetal personhood’ argument in attempt to free client that could have consequences for women’s rights