I think this might be a bug in Rails 6.0.2.2 so I am submitting it on the Rails issue tracker here Edit (but not create) Forms rendered through javascript using ERB appear to have their contents come after the close </form> tag, not within the form as expected · Issue #38919 · rails/rails · GitHub
stack overflow post here ruby on rails - form_with using a nested partial renders the form contents outside of the <form></form> elements tables, rendering content into a table row - Stack Overflow
any help would be appreciated!
In the meantime I will keep trying on lower versions of Rails to see if this is a 6.0.2.2-specific thing