No problem. This is on Legion 7.3.5 for the marksman hunter. Part of the talents you are given when you spec marksmanship is a chance for auto attacks to proc Marking Targets, it causes your next arcane shot or multi-shot to apply hunters mark. The proc happens within the first 1-2 auto attacks of each pull, and frequently during battle.
I'll share the FC when I get home but I've tried all free and paid FC's available for download here and they all have the same issue. I've also posted in some of those threads but they seem dead.
I considered the possibility that maybe either arcane shot or multi-shot was bugging out when this procced, but even if you go into Sidewinders (replaces both arcane shot and multi-shot) this still happens.
I'm not great at using the LUA scripts when coding like the OP of this thread but he was running into nearly the exact same issue a year ago and doesn't seem to have been resolved. All I'm doing is telling the bot to do a simple rotation and not even worry about / look for the proc, it still stops working.
Logs tell us nothing, there is literally no entry for anything happening while it just hangs, even with all log types turned on. I usually am able to fix any issue because its user error but in this case it may not be.