I'm building a flow where I want to be able to attach a variable number of files to an email sent using the Office 365 Outlook "Send an email (V2)" action. This action allows you to specify the name and file content of each attachment individually, but in this case, I need it to be scalable (allow attaching one file, two files, three files, etc. as needed). A trick I learned a while back (for sending SharePoint list item attachments as email attachments) was to create an array variable with the file name and content defined as properties, like this:

Then, in the "Attachments" section of the send email action, switch to "text mode" and drop in the array variable, like this:

This seems to work some of the time, but more often than not, the send email action fails, reporting that the Attachment Content cannot be null or empty:

I was testing this yesterday afternoon in preparation for a meeting with a client today and it seemed to be working reliably. When I replicated the steps into the "production" flow and tested it, the action consistently fails. I then went back to the test flow and that, too (which is configured exactly as it was yesterday afternoon) is now failing consistently.
What I think will work (if I can figure out how) is to have a "delay until" loop that runs until the "ContentBytes" property of each item in the varFileAsArray variable is not equal to null (although, it would be sufficient to wait for the last item in the array, since they'd be appended in serial order). I just don't know how to write the expression to extract a property from the last object in an array.