i think it's just one of those things people say without really giving much thought into it, like when someone calls you on the phone and asks you "are you awake"? i mean it makes no sense.
i personally don't find it neither rude nor kind by default, i think it depends mostly on the context. if it comes from a total random stranger i'd take it as just one of those things people say without really thinking what they're saying. if it comes from someone close who knows more about your personal situation, it would largely depend on the context and HOW they're saying it.
since you said you already had one unplanned pregnancy, and this answer comes from a friend who knows that but didn't know you were TTCing, i'd expect that, although it's not their business. if it sounds just like a normal curious question i think it's ok to ask, tbh, in this situation, but ONLY in case it's a close friend AND if they're NOT implying anything bad or being cynical, just surprised... and if such question comes after a "congratulations" and "how far along are you" etc...
someone in my family had a surprise BFP just 4 months after having their 2nd child and this question came up randomly but honestly, in 99% of the cases it was because of a honest, happy surprise (which that baby was as the mommy in question was still breastfeeding and hasn't had a period between the birth of the 2nd baby and getting pregnant again! she thought she was coming up with a stomach bug...)... so no one was frustrated or offended. i think it really depends a lot on the context.