No acts 8:22 was spoken to one man. Simon. A man who had obeyed the gospel then fell back into sin. Peter then explained that he needed to repent and pray for forgiveness.
Thats not what the verse says.
That is incorrect and misunderstood by you.
Simon had not obeyed the Gospel as you state.
Simon had never even received the Holy Ghost, and when Simon saw that the hands on people by the Apostles gave the Holy Ghost he wanted that too.
Acts 8:18 And when Simon saw that through laying on of the apostles' hands the Holy Ghost was given, he offered them money,
To obey the Gospel is obedience of faith, Simon never had faith and that is why he made the mistakes he made.
Also, the word does show repentance is not to be repented of, we do not draw back to perdition, but believe to the saving of the soul. Hebrews 10:39.
Simon was this:
Acts 8:23 For I perceive that thou art in the gall of bitterness, and in the bond of iniquity.
Hebrews 12:15 Looking diligently lest any man fail of the grace of God; lest any root of bitterness springing up trouble you, and thereby many be defiled;
Luke 8:13 They on the rock are they, which, when they hear, receive the word with joy; and these have no root, which for a while believe, and in time of temptation fall away.