The Hebrews believed they were worshiping YHWH in the incident with the golden calf, or at least that's what they said. They weren't stupid. They didn't believe the calf was actually YHWH. Rather, they probably made it as an intermediary, more a replacement for Moses than for YHWH himself. People are always trying to put more intermediaries between us and God. Bibles, saints, relics, clerics, politicians, etc. These can all be golden calves.
#exodus 32:4-5