The order is similar to a search warrent. Some judges are known for being relatively easy to convince to get a search order. Some are harder.
The OP question also leads to a bigger issue. In the USA anyone can sue anyone even for stupid reasons. And you have to defend against it. The only recourse you have is to file a countersuit for material losses.
So in the OP case if you were ordered to comply, you could sue the mother for the time lost and money damages if any. This is further complicated because the person would have to minimize losses to collect. I remember reading one case where the person countersued for lost work. But the judge ruled since the defendent took vacation time off, he wasn’t out anything so he didn’t get any compensation for damages. Some judges might not rule that way. It’s the luck of who you draw often.
Different states have different laws. In the old days state laws generally said, the person the mother is married to at the time of birth is presumed to be the father. In a lot of states, this has never been changed. So we wind up with odd things, like the mother having an affair, giving birth to a child that isn’t hers. A few years later she divorces and marries the biological father and the ex-husband is stuck with child support.
When the judges ruled like this, the answer was, “I’m following the law, if you don’t like it, change the law.” But that still hasn’t happened in a lot of state.
Some states also limit the time the father who is on the birth certificate can challange. There have been cases of mothers putting names of men on the birth certificate, and only much later did the man ever find out he was listed on the birth certificate and he wound up paying child support.
Some of these laws have been repealed or overturned but unfortunately too many exist. The ideal way is to perform a DNA test on every baby born. This of course has been condemed as wasteful in terms of money and resources. (Those who oppose say the DNA testing could be better used on criminal cases).
But as DNA testing gets easier and easier and more accurate, it’ll some day likely be the norm.
And also remember just because the woman can’t get the guy in, let’s say the judge won’t comply to issue a court order, she can always use another jurisdiction or wait and try to get another judge.