I think it would probably need to be "Ĉi tiu ne estas sukero sur la kokaĵo" (this is not sugar) rather than "ĝi ne estas" (it is not sugar).
In my considered opinion, this is more correct than to use ĝi. However, Esperanto doesn't use the indicative in the same manners as does English. So there is no place in this sentence where ĝi (a pronoun) could grammatically fit; unless one were to use it to replace the word kokaĵo.
Keep up the good work.
Right, but the present sentence is not impersonal. "Sukero" is the subject, even though it follows the verb "ne estas" and does not precede it.
It's just that the English word “there” in the combination “there is” does not have an independent meaning and cannot be translated separately. Esperanto translates “there is/are” just by “estas” (is/are). My native language doesn't use “there” in such cases either.