You could do that using the U parameter on the Dial to the destination device. See the example headed “Dial with post-answer subroutine executed on outbound channel” in Asterisk 15 Application_Dial - Asterisk Project - Asterisk Project Wiki. Obviously you would need to change Playback.
That doesn’t explain why your python script is failing, but even the limited logging you have provided implies that System has been executed.