And since the only thing that "afflictions and punishments" are necessary for is... afflictions and punishments, your God is not omnipotent since whatever ends are otherwise served by such could be served without such.
WHAT?! I’m confused. Ends served by what?
God either creates "afflictions and punishments" for some purpose (whether that purpose is afflictions and punishments or something else) or they are capricious and unnecessary.
If they are created for some purpose other than themselves, then either God could use some other means and chooses not to (in which case it is evil), or cannot use some other means, in which it is not omnipotent.
If they are created for their own purpose, then God is evil.
If they are capricious and unnecessary, then God is evil.
God is evil or not omnipotent.