More than likely, you didn't let the cookie dessert cool down completely. If the dessert is still hot or warm, the icing will end up melting right off the top.