Google Sheets QUERY () | Use cell text as a table range reference QUERY ()

Basically, I try to use the text of a cell as a range reference (array using wavy brackets) in a QUERY () function. I have two formulas created to perform a SUM function:

The QUERY () function that works as expected when the range is entered manually.

= QUERY ({& # 39; sheetname # Range; ...}, "Select Sum (Col1) where Col6 = & # 39;" & $ J5 & "label sum (Col1)" " )

And a TEXTJOIN () function that combines a list of all tab names in my sheet, while placing it in the range format used in the QUERY () function above.

= "{& # 39;" & textjoin ("$ E: $ E; & # 39;", 1, indirect ("$ P $ 7: $ P $" & COUNTA ($ P $ 5: $ P) +3)) & "})"

However, when you enter only the cell reference in the QUERY () range, the text of the TEXTJOIN () cell is not used as a reference. I've tried TO_TEXT () and some other functions to try to make this work, but I do not understand it. Ideas?