Here are a few things you can try. Put the mixture back in the pan and warm up slightly. Dont squeeze the mixture else the ghee will start oozing out. Stir for 1-2 minutes then and pour back in the greased plate. Smooth the top with a spatula. Leave to set in the fridge to set. The ghee will get cold and the barfi will hold shape.