Should a mother lose custody of her children if she knowingly has a convicted child rapist boyfriend living with her?

Just curious, should that be enough for a mother to lose custody of her children?

The situation is this, the father is filing for full custody in this situation because the mother has a convicted child rapist living with her. Not just convicted once, but 3 times and is required to register him self as a pedophile online. Additionally he is required to never be allone with children for any reason.. I just watched a 4 hour set of court sessions that happened over a period of 4 years where the court practically bent over backwards to keep the children with her, even though she is essentially marrying a child rapist. She lied to the court repeatedly about said child rapist living with her. Eventually the father won custody, but it took him years.

In my opinion, once proved that she was living with a child rapist, she should have lost custody immediately, and permanently.
Updates
1 y
here is the trial in question keeping in mind its over two hours long.

https://www.youtube.com/watch?v=Twc9Nh-r16o
Should a mother lose custody of her children if she knowingly has a convicted child rapist boyfriend living with her?
Post Opinion