It's actually possible by storing the loaded table (the result of the query) in the beginning of the query and buffer it (to keep in memory).
Then you need to construct a logic where to load (append) again the commented lines.
Without seeing some sample data that's difficult to explain (for me at least) how to approach it.
So the query starts with some like =Table.Buffer(Excel.CurrentWorkbook(){[Name="QueryName"]}[Content])
Then you must construct a logic to identify the comments and know to which project they belong too.
Buffer that result too.
Then apply the original query code.
In the end append/merge, sort, whatever ... logic that's required to restore the comments in the correct order under the correct project.
There will be situations where this is not so easy as it looks, and you'd need to adapt your code in a dynamic way to deal with those situations.
It can be considered advanced M.