There are so many assumptions on this thread, that the man in question was lonely, living alone, had the beginnings of dementia, trying to be friendly, all suppositions.
He on the other hand, is also making an assumption that this comment is welcome, he is not taking into account the possible feelings of the person he is directing it at. Apart from the fact that most of us don't go around with a fixed smile on our faces, there could be other factors that come into play, possibly the person is perhaps feeling unwell, has just received devastating news, a terminal diagnosis, the loss of parent/spouse/child/friend/dog/ cat and inside they are feeling deep sadness. they could have some form of facial paralysis from say Bells Palsy for example and literally can't smile. All of which wouldn't be any of his business and wouldn't necessarily be up for discussion with a perfect stranger. I don't agree there isn't any harm in what he said, the example I gave up thread of the woman who had it said to her by a bus driver after she'd walked away from her baby who had just died, literally tipped her over the edge. The point is someone could just, just be holding it all together and then that's the one remark that opens the floodgates, or triggers a complete meltdown.
In any event Witzend wasn't in a position to talk to him in the moment, she was busy concentrating in keeping up with her cycling young grandchild. Many of us suffer from delayed reactions, in that respect maybe drawing his attention to the personal and quite rude nature of the remark at a later stage might give him food for thought on how to address strangers in the future.