8:21 You have neither part nor portion in this matter, for your heart is not right in the sight of God. 22 Repent therefore of this your wickedness, and pray God if perhaps the thought of your heart may be forgiven you. 23 For I see that you are poisoned by bitterness and bound by iniquity.”
24 Then Simon answered and said, “Pray to the Lord for me, that none of the things which you have spoken may come upon me.”
Do you see the problem? Simon did not desire the character of God, just the power of God. He didn't want God's Spirit so he could be a blessing to others. He wanted the power of God’s Spirit so He could bring attention to himself and make a name for himself.
When Peter exposed his true motives and the consequences of such a selfish heart Simon asked Peter to pray for him. On the surface that seems like a good thing but notice what he asked for. He did not ask for a new heart and pure motives. He only asked for freedom from the consequences of the heart that he had.
The difference between the two is huge. Worse is that it underscores that we just don't get it. God does not arbitrarily impose consequences when we don't do what He wants. That is manipulative controlling human behaviour. When God calls something sin it is because it carries with it its own natural consequences. We can't escape them or pray them away. No exception can be made because we ask for an exemption from the consequences. Simon wanted to stay the way he was without experiencing any of the side effects. It is essentially like throwing yourself from a skyscraper without any safety gear or precautions and asking God to spare you from harm.
The bottom line is this. Sin is destructive. Always. If God says something is bad it is not because He is arbitrarily putting restraints on us. It is because it really is bad. We can pray for healing or prepare for hurt. There are no other options.