This talk by David Guzik at the Greenock Revival Conference helped me to get some perspective on the topic of PUBLIC confession.
https://www.sermonindex.net/modules/mydownloads/visit.php?lid=18253
There are three places in the New Testament where it is mentioned very clearly. (There may be others.)
Luke 19:7 And when they saw [it], they all murmured, saying, That he was gone to be guest with a man that is a sinner. 8 And Zacchaeus stood, and said unto the Lord; Behold, Lord, the half of my goods I give to the poor; and if I have taken any thing from any man by false accusation, I restore [him] fourfold. 9 And Jesus said unto him, This day is salvation come to this house, forsomuch as he also is a son of Abraham.
Notice how the general public had an opinion about the man because of his public sins. This knowledge is implicit in his confession to the Lord because he not only promises to give half his wealth to 'the poor', but individually to make restitution to the people whose names are on his conscience.
Acts 19:18 And many that believed came, and confessed, and shewed their deeds. 19 Many of them also which used curious arts brought their books together, and burned them before all [men]: and they counted the price of them, and found [it] fifty thousand [pieces] of silver. 20 So mightily grew the word of God and prevailed.
Here again we see that the whole community at Ephesus had been affected by the practices of 'curious arts', and those responsible who had come to Christ, if not before, now all knew each other - and their victims - and made a public statement of renunciation together, to that community. And God blessed them.
(But we know the local makers of idols weren't happy when their trade dwindled. There is always a cost to others, which can never be more important than pleasing the Lord.)
2 Corinthians 4:1 Therefore seeing we have this ministry, as we have received mercy, we faint not; 2 But have renounced the hidden things of dishonesty, not walking in craftiness, nor handling the word of God deceitfully; but by manifestation of the truth commending ourselves to every man's conscience in the sight of God.
Here, again, Paul and other Pharisees had been in public ministry, and although this statement is made in a letter to Corinthians whom we think of as Gentile, there was quite a Jewish presence in Corinth, and, the epistle would have been read to the whole church.
[Acts 18:1 After these things Paul departed from Athens, and came to Corinth; and found a certain Jew named Aquila, born in Pontus, lately come from Italy, with his wife Priscilla; (because that Claudius had commanded all Jews to depart from Rome:) and came unto them. And because he was of the same craft, he abode with them, and wrought: for by their occupation they were tentmakers. And he reasoned in the synagogue every sabbath, and persuaded the Jews and the Greeks.]