Radio buttons are supposed to be created as sub-elements of a single form element, as documented here:
If you search Moodle's codebase you'll see this isn't used:
git grep -e addElement --and -e radio
Instead each radio button is added directly to the form as it's own form item with a blank label and an extra heading added above it. This still works because the same id is used for each radio button so they're treated as part of a set by the browser. But it looks ugly, particularly if you set each of them as required fields.
It also interferes with the responsiveness of the forms, since that code treats them all as indivdual form items and headings.