There is no contradiction. Yep, they are consumers and to sell them gas brings Russia profit given the supplies are paid for. That is why nobody is going to lock the valve.
The situation you are talking about was caused by Ukrainian non-payment but the valve wasn’t locked.
When you have an intermediary in such business who are also a customer there are peculiarities.
Let’s say Germany consumes X volume and Ukraine Z volume.
It order to deliver down the pipe Russia pumps into Ukraine X+Z with Ukraine withdrawing Z and X gets by to Germany.
In case of non-payment crisis Russia pumps X volume into Ukraine and expects it to flow directly to Germany. In real life Germany gets X minus Z because Ukraine still withdraws the gas based on ‘necessity’.
At the end Germany doesn’t get its gas it paid for and Russia doesn’t get paid for service de-facto delivered. And Ukraine sent both a bill for transit fees.
With all the respect to Ukraine being poor and in need it doesn’t make this situation right.
That alone justifies direct link.
No, there was no “non-payment” by Ukraine, but the gas got shut off when Ukraine protested against arbitrary rate-raising by Russia.
I’m very sensitive to anti-US sentiment by both Germany and Russia, particularly in the economic sphere, and there is a lot of anti-US propaganda in the air in both of those countries. Historically, any cooperation between them has been a precursor to war.