this has occurred because when allah the one was prayed to you used to disbelieve and when a partner was ascribed with him you used to believe so the command is only for allah the supreme the great.
ذلكم بأنه إذا دعي الله وحده كفرتم وإن يشرك به تؤمنوا فالحكم لله العلي الكبير