I've only seen this behaviour when using radio button type widgets, sadly don't have time to fix it since I need custom HTML anyway so I am not using said functionality.
My suggestion would be to omit the ID's entirely so the dev must define them if they need them (in most cases they won't) or increment them with a prefix starting from _0.