I have now debugged this further, and I have found at least one reason why the whole macro is sometimes aborted when it's waiting media play action to complete. The problem lies in when another macro is running at the same time and it's also playing media (for example, speat text action). I also found that this concerns the speak text action as well if the checkbox "wait to complete before running next action" is checked.
These two test macros illustrate the bug:
As seen in the system log (all logging options enabled) the Test 1 macro is aborted after the first action (Speak Text) and the subsequent actions are not run. To confuse things more the last two actions of the Test 2 macro are run twice.
I don't think this is a device-specific issue so I'm tagging
@MacroDroidDev if he could test this and fix the issue if it's not just my device behaving strangely.