Prohibited: Inventing comparisons about Allah and making beliefs depend upon them.
Qur'anic illustration: An example Allah Himself provides to clarify a reality.
Once these are distinguished, there is no conflict between “do not set forth comparisons for Allah” and “the likeness of His light”.
What people may not devise on their own may still be given by Allah Himself as an authoritative explanation.