They are really picky regarding child visa in any case. Have you tried to call the immigration visa hotline? Ask them what is real law and why you are denied. If the child is yours according to court in Thailand I do not see the issue as well. You could take immigration to court or try to talk to a supervisor.
I got answer from Swedish Embassy now according to them the IM in Rayong and Pattaya have started to do this now. Sometimes they care sometimes they dont want it. I will close the the thread now.
The ask:thailand community, consisting of multiple Q/A groups with over 100,000 members, powers this platform. It is not an official government resource. Our members actively contribute to this resource, and while we strive for accuracy, we cannot guarantee its complete reliability. Assistance to travelers is provided as a community service.