For this one instance, I probably would have said "Like you, I assumed niece would enjoy visiting and joining the conversation."
I before using either of the below approaches, I'd try to understand if her attitude is because she is insecure around you or if she is like this with everyone. If you think it is insecurity, just smile indulgently and change the conversation.
But if is a know it all to everyone, then these are how I deal with a sister of mine who annoyed the crap out of me trying to parent me through my adult years.
For other "teaching moments" that you don't agree with, keep a bored smile on your face, wait for her to finish and respond with "What an unusual perspective." or "Thanks for the suggestion but I don't think that will work for me." If she asks why, just say you find it a unique thought pattern or action but it's probably best to not discuss right now. If she keeps pushing, saying you don't want to discuss it. It will drive her crazy for the next month. If she brings it up again, say you don't agree but don't see any reason to debate with her as she seems pretty committed to her position as you are to yours. If she pushes again, respond with "Why are you so insistent on discussing this? Or is it that you aren't sure of your position?"
If you do agree with the assessment or comment, keep the same bored smile and respond with Oh, did you just learn about this? I thought it was common knowledge." People hate thinking that are the last to learn something.
Yes, sister tries to portray me as unreasonable, but everyone knows why she thinks that way.