I assume it went like this:
Fruchtgummi/Weingummi (Gum candy/Wine gum) was invented around the 1880.
Haribo created a branded variant called “Tanzbären” (Dancing bears) in 1922.
Those got dubbed “Gummibären” in the vernacular, making it impossible to trademark the name later.
So they went with “Goldbären”, to emphasize that they are the original.