Assuming this is in reference to VGC: there are actually formal regulations for players who fail electronic hack checks. This full list of rules can be found here on the Pokémon Company’s website.
In relation to your question, Section 4.1 of the rules says that modification of Pokémon is ‘expressly forbidden’, and will result in consequences ‘regardess of whether the Pokémon or items belonging to the player were traded for’. However, the rules never mention lifetime bans: only disqualification and forced losses.
The rules list goes into some more detail in Section 5.4.2 and Appendix A, showing the different penalties applied for different severities of hacks. In short:
If you have a Pokémon that is at an impossible level or in a Pokeball it can’t possibly be in, it’s considered a minor infraction. You instantly lose the match, or your next match is considered a loss.
If you have a Pokémon with illegal attributes (moves, abilities, etc.) or an impossible Hidden Power type, it’s considered a major infraction and you get disqualified.
So if you get a minor infraction, you can actually keep playing if you remove the Pokémon. But if you remove so many you don’t have a valid team anymore, you obviously can’t participate. Basically, don’t enter hacked Pokémon because it won’t work in your favour.