If you have a caloric deficit, you'll lose weight. Doesn't matter if you get all your
calories from
fat, sugar, or what have you.
Now, from a nutritional perspective, getting 100% of your
calories from
fat or sugar is pretty undesirable. You're the one who picked your targets for
fat / sugar / carbs - what were you hoping to get out of those targets? If you're over on one or more of them, are you still going to meet your nutritional goals?
I'm usually in the range I want to be for macronutrients (and micronutrients, for the most part) when you look at a week at a time. But on any given day, I may be heavy on one thing or light on another. That's not a big deal, at least not to me.