Margarine is a highly processed food made by ... artificial colourings and flavourings and salt. There are many types available using different fats and with differing flavours and uses.
Recipes that explicitly call for margarine should ideally take these differences into account. In any case, pay attention to the type of margarine you're using. You'll want to avoid any margarine ...