Without knowing more details, it sounds like extortion. Hopefully, if you were facing jail time, you had a lawyer to advise you, so I suspect the answer to the question "how is this possible" would need to be accompanied by additional information in order to get an accurate response. In any event, there is certainly nothing to prevent you from hiring a lawyer to determine whether it is too late to try to get "your kids back."
That sounds like extortion/coersion. I would need more information to make a determination, but did you have a lawyer assisting you. If not, you need to look at obtaining one immediately.
I would definitely need ,more information to provide you with the correct answer. Perhaps you can re-ask your question.
Years licensed, work experience, educationLegal community recognition
Peer endorsements, associations, awardsLegal thought leadership
Publications, speaking engagementsDiscipline