It would seem that this was caused by the calendar color being the same color as the color used for the events to be processed. When a color isn't set, the default calendar color is shown for the event, but the event color is returned as null. It was particularly confusing as some of the events were set to that color but many were not, with the identical calendar color showing up. However, when I would specifically set the color of the event to another color and then back to this specific color, the colorId for the event would still be null.
This seems to be a bug to me. In my mind, the color of the event should always be returned, even if the user let the event be colored the default calendar color. However, even barring that, when the user creates an event, but doesn't assign it a color, letting the default calendar color be used, but later does assign it to a different color, and then later still assigns it to the same color as the calendar color, that color should be returned, and I believe that the color should additionally no longer be changed when the user changes the calendar color. For that functionality, there should be a color option which is "calendar color".
Additionally, it would seem to be a bug that throughout this calendar, randomly, events that have the calendar color also have the event color set. This is what made this even more confusing to me when debugging this issue. These events are sprinkled throughout the calendar, so it doesn't seem to be connected to when the calendar color was set to this color, but perhaps my client was periodically changing the calendar color for some reason.
Perhaps the best solution would be for the calendar color options not to include the event color options. When a user selects a calendar color that is not amongst the event color options, all of these problems are avoided.