I can't say I've studied it. What do you think it refers to?
For it would have been better for them not to have known the way of righteousness, than having known it,to turn from the holy commandment delivered to them. 2 Peter 2:21
Notice it doesn't say "holy commandments", but holy commandment.
The Holy Commandment of the Gospel, that we are all called to obey is: Repent.
Peter uses the phrase - turn from the holy commandment...
Repent means to turn to God.
If you are called to turn to God, then by default you are called to turn from Satan as your lord.
The way that your express this obedience of faith, concerning the Gospel is to confess Jesus as Lord.
This is what grants the believer/obeyer of the Gospel, the forgiveness of sins.
This is plainly what the Lord Jesus Christ taught to and commissioned Paul to do.
15 So I said, ‘Who are You, Lord?’ And He said, ‘I am Jesus, whom you are persecuting. 16 But rise and stand on your feet; for I have appeared to you for this purpose, to make you a minister and a witness both of the things which you have seen and of the things which I will yet reveal to you. 17 I will deliver you from the Jewish people, as well as from the Gentiles, to whom I now send you, 18 to open their eyes, in order to turn them from darkness to light, and from the power of Satan to God, that they may receive forgiveness of sins and an inheritance among those who are sanctified by faith in Me.’ Acts 26:15-18
Repent is about being transferred from the kingdom of darkness to the kingdom of God.
It's about changing who you serve, as your Lord.
The Gospel of the kingdom is about changing the kingdom your are in, by changing the Lord you serve.
The Gospel is God's call to humanity, to "come out of hiding", in darkness, and to come into the light, the kingdom of light.
He has delivered us from the power of darkness and conveyed us into the kingdom of the Son of His love, 14 in whom we have redemption through His blood, the forgiveness of sins. Colossians 1:13-14
These that Peter refers to here in 2 Peter 2:20-22 have turned from the holy commandment, or as it were, they have "un-repented" or have turned back to serving their former master and lord.
James says it this way -
Whoever therefore wants to be a friend of the world makes himself an enemy of God. James 4:4
JLB