When my son was little, he would say things like “Yes means no and no means yes.” He would also say things like “milk is good, butter is made from milk, cake is made from butter, why can’t I have cake for breakfast?”
Through persistence and speaking to him calmly, he eventually stopped his petulance. Usually if he wanted something, we would only give in after repeated conversations. We wanted to explore decision making with him and ensure he would not quickly want something else. The main thing I wanted was for him to talk and explain why he wanted something so bad.
I believe he only threw a full tantrum a handful of times. When that happened we followed the advice of pretending to leave without him. When he realized we were not rewarding his tantrum, he stopped.
In short, we wanted to reward him for communicating not for throwing a tantrum.