"Medical lawyer" is really the wrong focus, this is an issue of civil rights. The question would be, is it a violation of your civil rights to prevent you from taking your baby home; is it legal for the federal government to investigate people who refuse to take a covid test? You can take the question along with pertinent evidence to a civil rights attorney.
To pick a non-random hospital's web page, they note that "Any person having surgery or a procedure, including birth, at a Texas Health hospital will be tested for COVID-19 to provide appropriate care for the patient, and for the protection of visitors and the care team", and "you will need to be tested at admission to help safeguard you and the care team". In answer to the question whether you can decline testing, they say "Testing is recommended to promote the health of you and your baby. Patients who have COVID-19 can have a weakened immune system and may have inflammatory symptoms that can compromise healing. We encourage you to speak with your provider about the best decision for you", which doesn't explicitly say "No you may not", nor "Yes, you may". However, they cannot literally force you to take the test: at most, they can refuse to treat you.
In answer to the question "Will I be separated from my baby if I test positive for COVID-19?", they say "Texas Health will follow guidelines from the American Academy of Pediatrics, American College of OB/GYN and the Centers for Disease Control for how to keep you and your baby safe during your hospital stay. Ultimately, any decisions about care for you and your baby will be between you and your provider, based on what is best for you both". This is also not crystal clear.
There are three primary legal issues, putting a worst spin on their policy. They say up front that you will be tested prior to admission: the question is whether you can decline to take the test but force them to admit you. Now we are closer to the realm of a medical negligence attorney – they can refuse to treat you, but that might leave them liable.
The second question is whether they can temporarily take the infant away, against the mother's wishes (for example, hold the infant in a separate facility while the mother is in the hospital). The third question is whether they have direct authority to take the infant away when you leave the hospital. The third question gets a plain and simple no. The Texas Dept. of Family and Protective Services has some authority in such a matter, but taking a child requires an investigation and a court order.