>Convinced, as a scientific establishment, that your theories/dogmas about being straight/gay are correct, and subjecting the "sick" into electroshocks is not persecution?
That's exactly right!
The intent behind the medical practices you list is not to oppress, but to cure. It's misguided, horrific, tragic, etc., but persecution it is not.
>What's the definition of persecution you are using that doesn't include such cases?
The usual one. Citing Merriam-Webster:
1. to harass or punish in a manner designed to injure, grieve, or afflict; specifically : to cause to suffer because of belief
2. to annoy with persistent or urgent approaches (as attacks, pleas, or importunities)
The key point is that persecution is generally understood to require some sort of punitive or retaliatory intent, which is not at all the case of the practices you mention.
Moreover, you seem to be confusing "the scientific community" with "the political community", the latter of which is largely responsible for the misuse of scientific discovery in cases of actual persecution. N.B.: none of this was done in the name of science. To say that science has persecuted mankind to the extent that religion has is patently absurd.
In fact, and with my sincerest respect (really!), much of your above posts are absurd, conflating political/ideological persecution with varying forms of misguided medicine, recklessness, short-sightedness, etc. To be sure, these are all Bad Things, but persecution is a rather narrowly-defined concept, especially in colloquial use.