Since you didn't lose any reputation due to deleted posts, the explanation is probably that somebody upvoted or accepted one of your answers, thus raising your reputation above the threshold for the comment privilege, triggering the notification, and a short while later reconsidered and withdrew the upvote/accept, letting your reputation drop back to 40.
That behaviour, that a notification for an earned privilege is sent and not withdrawn when the reputation drops below the privilege threshold again soon after the notification, is confusing. But it's a comparatively rare occurrence (most of the upvotes or accepts one receives aren't the ones that make one cross a privilege threshold, and most upvotes/accepts are not withdrawn; even rarer is it that an upvote/accept that causes a privilege to be earned is withdrawn), so it is probably not worth to write code that detects that situation.