Seems like it was a accident and given the person's past behavior it seems fairly believable.
On social media, Gandhi explained that he "inadvertently" liked the post in question, which was written by a person he doesn't follow on X, formerly known as Twitter.