Inconsistent trade execution using MT5 and Python API

 

I have a trading algorithm set up with the MT5 python system and I noticed that it doesn't consistently execute trades as it should. I don't get any error messages, and if I re-run the algorithm again it will sometimes execute the exact same trade that didn't previously execute. No variables are changing, it just seems that MT5 is choosing to repsond when it feels like it.

Does anybody know why this might be happening?