I don't think that it is likely that the main beam warning is coming on as a result of the shared earths. It's possible, but highly unlikely.
I have seen warning lights coming on because earths were shared, but that was on a car trailer, with 6 metres of earth wire shared with all the trailer lights.
On vehicle wiring, you should get less than 1 V drop from the battery to any load, so less than half a volt of loss in the earth cable. That isn't enough to turn on a warning light.
You are correct that an H4 bulb has a single earth terminal, so there will be some voltage on the earth, and therefore on the main beam connection, when the dip beam is on. However, unless something is really wrong, that voltage will be very small and won't cause the light to turn on.
I think that you have got some of the connections wrong on the H4 bulbs. I suspect that you have got the main beam and ground connections swapped on the bulb. Bulbs work both ways round (some motorbikes power the bulbs from alternating current) so the main beam will work perfectly when run like that. However, on dip beam, you will get both filaments in series. The light output will be poor, and there will be light in the wrong places as half of the light will be coming from the main beam filament, and the colour will be yellowish, and the light would be a bit slower to turn on, but none of those effects are really dramatic and most people wouldn't notice. Dip beam would still be a big bright light that others could see, and main beam would be as normal, so it would work quite well.
The big difference is that the main beam connection would be around 6 V on dip, which is likely to illuminate the main beam warning light.
I suggest that you search for images for "h4 pin out" and you will see how it is supposed to be wired. The middle connection is low beam, and I think that you might have the other two swapped.
There is another issue, which could cause the warning light issue, or other problems. The H7 bulbs are 55 W each. The H4 bulbs are 55 W on dip and 60 W on main, but you have two of them, so main will be 120 W and dip will be 110 W, approximately double what you had before. It's not a good idea to double the load on the switchgear and wiring. A common fix is to put a relay for each circuit, and a feed to that relay from the battery (via a fuse) so that the relay takes the current of the extra lamp and the only extra load on the vehicle's wiring is the relay, or the change from 55 W to 60 W, which isn't significant.