core: fix crash when creating two bars with same name but different case (bug #41418)