Custom content entity field widget. This value should not be null
I managed to get it working by extending the OptionsButtonsWidget class instead of OptionsWidgetBase. I've also added the multiple_values annotation which I was missing and also removed the validation callback I was supplying, so now the validateElement method from OptionsWidgetBase is the validation handler used. My widget class just extends OptionsButtonsWidget and works fine. I think the missing annotation was the main reason it wouldn't validate.