I am not a doctrinal expert, but I will share one point of view and perhaps someone wiser can correct it.
The question presumes, in some ways, that God is a mere automaton and salvation a machine that requires specific (name removed by moderator)uts and grants corresponding outputs. In all reality, God is a person - a loving and thinking being. Salvation is an act he performs by his free Grace for a sinful humanity.
The normative way in which he has instructed men to seek this grace is through “baptism for the forgiveness of sins.” Knowing full well his instructions and seeing the opportunity, we are without excuse who refuse to follow them. But we shouldn’t therefore conclude that it is somehow unfair or impossible for God to act in any other way. The catechism says in 1257 that:
“God has bound salvation to the sacrament of Baptism, but he himself is not bound by his sacraments.”
When God commands us to be baptized and then we are told of a situation in which he saved someone without baptism, our response should not be “so it IS possible!” Of course it is possible for God to forgive sins in one who is not baptized. With God all things are possible - he could have told us we had to do a hopscotch in order to be saved and we would have said with submission “thy will be done.” This is why we seek his mercy and trust in his love for those who are not baptized. The important thing is not what sacrament he binds salvation to, but rather that we seek to gain that salvation by whatever normative means he has given to us.
To put it another way - in the parable of the laborers, the owner of the vineyard hires a man to work for a day for one denarius. He then hires men to work for part of the day and a man to work at the last hour - all for one denarius. In some ways, one can liken the thief on the cross to the man hired at the last hour - perhaps even an hour too late to receive all the normal means of salvation. He was not present when the workers were completing whatever had to be done in the second hour. But if the workers in the second hour had stopped and said - “wait a minute - you really don’t need to do this work to get paid. You just need to wait until then and work,” it would most likely not have gone over well. They were not performing an act that had a natural result and could be isolated and simplified, like a “sinner’s prayer.” Rather, they were acting in obedience to one who was merciful enough to hire them and who could have simply chosen not to pay them at all.
So the thief did not “deserve” salvation at all for his works. Neither does any upright Christian who has served God all his life. Works - and baptism - do not earn salvation, which is a product of God’s free grace distributed as he wills it.
for, “Is it not lawful for me to do what I wish with what is my own? Or is your eye envious because I am generous?’” (St. Matt. 20:15)
But he has chosen to distribute it primarily through baptism and commands us to perform certain works. So by the same token, the lifelong Christian does not now have a pass to skip the years of following God because they are apparently unnecessary. Just because the thief (or an unbaptized infant, etc.) was not baptized does not mean God has not given it as a normative requirement for salvation. The last worker hired did not do whatever was to be done in the second hour, but it is probably a safe assumption that the first worker hired would not have been paid if he had refused to do it.
Read Ezekiel 33 and Matthew 7:21 also…
In other words, personal responsibility is still a factor, despite the fact that salvation may be possible through other means. This made me think of a couple of Scriptural verses:
*20 For if, flying from the pollutions of the world, through the knowledge of our Lord and Saviour Jesus Christ, they be again entangled in them and overcome: their latter state is become unto them worse than the former.
21 For it had been better for them not to have known the way of justice, than after they have known it, to turn back from that holy commandment which was delivered to them.
22 For, that of the true proverb has happened to them: The dog is returned to his vomit: and, The sow that was washed, to her wallowing in the mire. *
2 Peter 2:20-22
Personal responsibility to obey God’s Word entangles not only the repentance of sins, but also the willingness to follow all of the precepts of God and His Church which He built (St. Matthew 16:17-19)
26 For if we sin willfully after we have received the knowledge of the truth, there no longer remains a sacrifice for sins,
27 but a certain fearful expectation of judgment, and fiery indignation which will devour the adversaries.
28 Anyone who has rejected Moses’ law dies without mercy on the testimony of two or three witnesses.
29 Of how much worse punishment, do you suppose, will he be thought worthy who has trampled the Son of God underfoot, counted the blood of the covenant by which he was sanctified a common thing, and insulted the Spirit of grace?
30 For we know Him who said, “Vengeance is Mine, I will repay,” says the Lord. And again, “The Lord will judge His people.”
31 It is a fearful thing to fall into the hands of the living God.
Hebrews 10:26-31
Again, personal responsibility is crucial. Had the thief known of the ways of God prior to his own crucifixion right next to God, and had he ignored the precepts and ways of God even with full knowledge and consent, he probably would not have defended Him
*40 But the other answering, rebuked him, saying: Neither dost thou fear God, seeing thou art condemned under the same condemnation?
41 And we indeed justly, for we receive the due reward of our deeds; but this man hath done no evil.
42 And he said to Jesus: Lord, remember me when thou shalt come into thy kingdom. *
St. Luke 23:40-42
And I wonder if Jesus would have said those famous words:
*43 And Jesus said to him: Amen I say to thee, this day thou shalt be with me in paradise. *
St. Luke 23:43