I imagine that it happens with a language other than English.
If so, check that the phrase alert_profile_post_insert is well translated, with its original variables and links.
Sometimes you translate the name of a variable by mistake and everything stops working, as is logical.
I don't know if that's what's happening to you.
Master value:
{username} wrote a message on <a {profilePageLinkAttributes}>your profile</a>.