This phrase comes from a story about a thief. This thief had quite a cunning plan. He poured some alcohol or poison into some rice and then fed it to some dude’s chicken. The chicken collapsed and then he stole it. Later this bad hombre ate the chicken and died.
This phrase is used to describe a situation where someone acts with evil intent, but fails to achieve their goal. There’s a viral video going around in Hong Kong that depicts a very good example of this.
A man goes up to a restaurant and orders take away. The cashier states the price and the man hands the cashier a $100 bill. The cashier takes the bill and opens the cash register. When the register is opened the man pulls out and extends a paper cutting knife and says “give it to me”, referring to the cash in the open cash register. The cashier pauses for a few seconds, then puts the bill in the register and closes it. The cashier then swears profusely and runs off screen to fetch a knife of his own. The would-be thief runs away and soon after the cashier can be seen running after him with a knife.
This is a really good example of 偷雞唔到蝕渣米. The thief tried to rob the restaurant, but ended up losing $100. I’ve added a link to the restaurant incident in the description.