If married when the child is born the father has parental rights as default. If not the father needs to apply via family court to get rights. DNA tests often involved etc.
As birth mother she obviously has the rights but this obviously defines what she can do without the father signature in regards to the child.
Actually you should be able to get re-entry permit on any stamp allowing you to stay in Thailand. Even 30 day visa exempt stamp.
I got one few years back when applying one year extension of stay while I was on "under consideration for 30 days".
Applied my extension based on marriage and while waiting the stamp did a trip overseas with re-entry permit and then went to get the extension stamp.
I vaguely remember getting re-entry permit years back when one year non-O multi entry to keep the last 90 days stay stamp after visa expiry alive with few days trip overseas for work.