It doesn’t seem like the correct behavior to me.
Oddly, when I first tried to reproduce the issue, I had the Discourse Reactions plugin enabled. With the Reactions plugin enabled, users can see the avatars of users who have liked their posts even if the user is not allowed to send them messages. That seems like the correct behavior to me.
With the Reactions plugin disabled, users cannot see the avatar of users who have liked their posts if the user who liked the post is not allowed to send them messages.
I’ll re-categorize this topic to the UX category to see if it’s something the Discourse team want to look into.