I think it is named “inventing a fictitious person who holds contradictory beliefs, in order to cast aspersions on one of those beliefs” and is a form of strawman fallacy.
I think it is named “inventing a fictitious person who holds contradictory beliefs, in order to cast aspersions on one of those beliefs” and is a form of strawman fallacy.