There is an example in scripture, spoken by Jesus, of the prayer of a sinner :
And the publican, standing afar off, would not lift up so much as his eyes unto heaven, but smote upon his breast, saying, God be merciful to me a sinner.
I tell you, this man went down to his house justified rather than the other: for every one that exalteth himself shall be abased; and he that humbleth himself shall be exalted.
Luke 18:13,14 [KJV]
I think this is the reason for the saying 'The Sinner's Prayer' and I think this is the reason that Protestantism, largely, advocates that those who genuinely feel their distance from God, their proneness to sin and their burden of past sins, should pray to God in penitence.
There is another saying :
What must I do to be saved ?
Acts 16:30 [KJV]
said by the Philippian jailor who was ready to commit suicide.
A prayer, in a way, but not exactly addressed to God, rather addressed (as many do, in their first approaches of repentance) to someone who represents God - an 'ambassador of Jesus Christ'.
The publican was in the temple, praying. The jailor was trembling and had already thrown himself down at the feet of the apostle. These men were at an extremity. They had reached the lowest ebb. They were distraught.
These prayers were wrung from them at the lowest point of their lives. They were far off from God : and they knew it. And these prayers were answered, and that immediately, in both cases, without delay.
The publican went down to his house, justified, without further ado. Just as Abel received a witness (from God) that he was righteous (in God's sight) after he offered the firstling of his flock, and the fat thereof, Hebrews 11:4.
Protestantism exists because justification by faith was preached by the Reformers. They taught that justification is by faith and that justification is a matter of the righteousness of God, not the righteousness of the law or the righteousness of humanity.
And they taught that genuine, penitent prayer receives an answer from God Almighty to the sinner who approaches in confession and repentance and faith. No works are required. Good works (in abundance) will, undoubtedly, follow. But no works of any kind can ever justify from sin. For that, blood must be shed - and that, from a clean sacrifice.
What is completely removed from this, is the practice of putting words into the mouths of people who are, largely, quite happy in sin, quite happy with life, quite content to be ungodly - and then promising them eternal salvation by the performance of a solitary, brief ritual.
There is no comparison between this objectionable modern practice and these examples of real repentance recorded in scripture.