No problem. Actually, you don’t need an invisible heading per say, just metadata.
#outline(target: selector(heading).after(<g1s>).before(<g1e>))
#outline(target: selector(heading).after(<g2s>).before(<g2e>))
#metadata("group 1 start") <g1s>
= My Chapter Group 1
== My Section Group 1
#metadata("group 1 end") <g1e>
#metadata("group 2 start") <g2s>
= My Chapter Group 2
== My Section Group 2
#metadata("group 2 start") <g2e>
As long as your groups are contiguous, it should be ok to write it like this.