If your burfi doesn’t set, it means you have undercooked the mixture.  Put the mixture back on the heat, cook for few more minutes till it leaves the side of the pan, and now set it again.