The primary categories are not exactly what dictates the color of an event when appearing on your calendars - the calendars themselves dictate the colors.

When you have an event that is being shared across categories, while those categories are in separate calendar views, the calendar view that is listed first will be the color for said event.

For example, if you have "Event A" listed in two calendars: Grade 11, and Grade 12 - because Grade 11 is listed first, the event will take the color of this calendar (even if Grade 12 is the Primary event category/calendar).