An old intelligence hand once told me that when your analysis is reduced to the remote psychoanalysis of what someone will do, you're in trouble. I can't claim to know what's inside of Putin's head on this issue, but certainly he is attempting to signal resolve.
I think his brandishing of the nuclear issue is a useful way for him to create fear and alarm—essentially, a strategy of terror in the west. He's suggesting that if faced with a loss he'll use nuclear weapons. It distracts from Russia's military shortcomings in the field. It gives humanitarian cover to those who say the war must be halted. It may discourage the west from providing certain kinds of weapons that would allow Ukraine to escalate the war. It allows Russian hawks to indulge in all sorts of bellicose fantasies.
I'm not sure the actual use of nuclear weapons would bring a significant military advantage, although Russia could destroy Ukrainian cities. It's not just propaganda, though. Putin does not have to convince his adversaries that he will use nuclear weapons. He simply has to create enough uncertainty that they don't want to run the test to find out.
I think that's what we're seeing here. We're seeing a shaping of perceptions, which are as important as battlefield progress in contemporary warfare.