I think that colons are not initially allowed on section classes. There’s two ways around that, though.
Create another wrapper inside the section markup.
Disable the validation check on ThemeCheck using a .theme-check.yml file on the root of your theme. Then, add a “ValidSchema” property and set enabled to false.
# Disabled validation of the schema.
ValidSchema:
enabled: false
This is not recommended, though. Since it disabled other schema validation.
What I actually wanted to suggest with #1 was, to make a different container inside the pre-rendered section by Shopify. It should look like so:
I know it’s a bit different from what you want but I’m assuming this is as far as it goes (my knowledge, that is) without resorting to magical scripts.