I was told for years that the annulment of the marriage does not make any children “bastards”.
The Catholic church has no concept of illegitimacy. That’s a secular legal term.
If the father is unknown, or “unknown,” the baptism certificate says “pater ignominiam,” father’s name unknown, if I have the Latin right—this is where our word “ignominious” comes from.