Exactly. Putin can refuse to sell the oil for the cheap price.
Why doesn’t he?
He already has refused.
But, that does leave him with a problem: There’s not enough transport to get over about half of his gas that used to go to Europe, anywhere else. As long as prices stay sky high, that’s ok for him - revenue is a function of volume and price. But, high prices will encourage new energy production elsewhere and that will gradually drive down prices (note that Pooty already has to give discounts to China and India, and also note Dutch TTF (futures) are already generally trending down.) Once the energy markets level out or (including Russian production) swing into oversupply, Pooty is in deep doo-doo.
That doesn’t mean I agree with the energy sanctions on Russia. The proper course would be to simply do everything possible to increase supply. No sanctions needed, in the long run.