As above, everything has been covered really.
Sugar is not the devil so there's no need to crucify it. Of course make sure your intake isn't excessive, even then occasional high days do not hurt. If you're consuming plenty of fruit then your intake will far exceed 20-30g which is horribly low anyway and I can only assume has come from an outdated government RDA or equivalent?
My only other point would be, where sugar is concerned, fiber the often neglected ginger stepchild of IIFYM.
As a target aim for 10-15g of fiber per 1,000 calories consumed. This stops you filling your macros with completely processed foods and forces good sources of nutrients & minerals, by association, in to your diet too. It'll help digestive transit as well.
Edit: Macro calculators provide a rough guide only. Please don't use one and take it as gospel that you should be gaining/losing on XYZ or start following said macros and wonder why you're seeing the opposite of what you desire.
Establishing your maintenance/gaining/losing macros is very much trial and error dependent on gender, age, total daily activity (sedentary job etc), exercise, and even hormonal/mental/psychological and gut health issues. Try to keep variables consistent while you establish a baseline.