in my experience, using dot notation in the field ID is representative of nesting. so this, to me, looks like you should have a field named “module,” with a child field “styles,” with a child field “margin,” with child fields “top” and “bottom.”
if your fields.json code above is the entire file, try changing all three instances of “module.styles.margin” to something like “module_styles_margin” (a single term, no parent-child relationship implied) or and see if that makes a difference in how it’s rendered.
your top and bottom fields would then have IDs module_styles_margin.top and module_styles_margin.bottom .
also, i noticed that you have a suffix of “px” on your margin fields, and then you also add “px” in your HTML file. that may or may not be related.
thank you, @Jaycee_Lewis. that does appear to work. it’s curious that i need that workaround.
thank you, too, @melindagreen, for your input. i did only include the relevant objects from my theme.json file. the nesting is set up correctly in the file itself. too, for reference, the suffix set in the json file is simply for display purposes in the content editor and has no effect on the numerical value of the field. the suffix is needed in the HTML to work properly. (reference)