Political affiliation may not be a statistical category collected by law enforcement (though I do question the veracity of that statement, but I don't have the means or the time to dig into it), but we absolutely do have enough info on things like the political leanings of offenders and other similar data points to make confident claims about such data when talking about specific types of crime.
Not saying that I don't absolutely want to see a source behind the claim as well, though. I don't take any of these kinds of claims without some kind of data backing it up. Just that I do know that we can make some confident claims on the political leanings of those guilty of things like mass shootings, as mere seconds before Charlie Kirk was shot he was in the middle of arguing with a woman who was citing statistics on the number of people shot by trans people over the past decade in mass shootings compared to the number of people shot by conservative white men in mass shootings over the past decade (something like 5 to 437 if I remember correctly).