What happens, morally speaking, if I promise to do something that happens to be
I think a lot hinges in your question on the word "slightly". Is there a moral obligation to keep a promise to do something that is "slightly immoral"? I think that the answer has to be "No", since the value of duty to keep promises is not in question, and the act contemplated is only "slightly" immoral. OK, but how slightly? Would it help if you had written, "if I promise to do something that is utterly and completely immoral"? Or if you had written, "If I promise to do something that is only ever so slightly, just the teeniest barely discernible bit, immoral"? I think such gradations make a big difference, and it is not very clear how "slight" the immorality has to be before it ceases to conflict with the important general obligation to keep promises. Of course much depends also on the question to whom the promise was give, why, under what circumstances, and so on. These all need spelling out before we can address the question with any hope of answering it.