That is the guidance of Allāh by which He guides whomever He wills of His servants. But if they had associated others with Allāh, then worthless for them would be whatever they were doing.
The guidance they received was Allah’s guidance, which He grants to whomever of His servants He wills. If they had associated others as partners to Allah, then their actions would be void, because associating partners with Allah nullifies good actions.