2 year olds adapt their behaviour to the person they're with. They don't expect people who aren't their mother to breastfeed them. It's as simple as that. It doesn't cause problems with their behaviour in other contexts any more than having one bedtime routine at home causes children problems having naps a different way at nursery.
You might know the answers to these questions if you'd ever breastfed a 2 year old. Breastfeeding a toddler isn't easy on the mother. It doesn't always easily fit around work or around other people's expectations. You might find yourself thrown out of a shop for instance. Or leered at by a creep. Or chastised by other women online (who ought to know better). That's why so few women do it (in our culture). It's something to choose as a child led way of parenting which is completely developmentally appropriate... Which is why children and their mothers are perfectly adapted to do so well into toddlerhood. Do you think evolution got this wrong and it's modern consumerism that has shown us the light?
The guidance is to breastfeed for a minimum of 2 years, in other words, yes to carry on beyond that as you wish. There hasn't been a lot of research into extended breastfeeding, because research has to be funded, and this often comes from companies who are setting out to sell a product. Breast milk isn't a product that can be sold. There is good anthropological evidence to suggest that extended breastfeeding is our evolutionary norm. So what evidence do you have to support discouraging, shaming and/or penalising this entirely normal human behaviour?
Why do you think breastfeeding a child now is setting them up for distress? Do you have anything to back this up? There are lots of things we do to comfort young children which they gradually move away from. We don't need to force very small children to grow up. They grow up whether we want them to or not.
Are you going to move onto cuddling next? Comfort toys? Did you decide at what age you were going to wean these activities? Have you ever said "Darling you're 4 now, so mummy's not going to sing twinkle twinkle any more, it's not appropriate and what would people think when you go to secondary school?"
What this comes down to is patriarchal sexualization of women's breasts. They are an organ whose primary purpose is to feed and comfort infants and children. End of. If you find breastfeeding children too sexy to comfortable with it, that's really a you problem.