Have you tried creating the output file, capturing the link or ID of the file, then, outside of the apply to each loop, get file content and attaching it to the outbound email?
High level idea:
Flow triggered
Variable to hold output file ID
Get Items
Loop
... do stuff
Create File
Set Variable to the file ID
Get File Content - ID = Variable
Send email - attach file contents
Haven't tested it, and I'm not 100% sure if you need to move the Create File out of the loop. Doing the Create File in the loop would result in the file being overwritten X times?