The steps you listed is what the bot is supposed to do.
However, In my case, the bot completes all the steps up to 5 after it upgraded the gem.
What it does next is that the bot teleports back to town and go straight right into the rift portal without clearing the backpack.
Normally, when the bot is going back to the rift to pick/clear what's left in the rift, the bot usually take the teleport portal it generates in step 5
But in my case, the bot goes back into the rift through "the actually purple rift portal"
It seems like the bot skips step 6 to 10 and goes back to step 1.
Since the rift portal is still open ,because it never talk to Orek to actually complete the rift, the bot re-enters a rift that's already been cleared and wonders around looking for mobs.
I've checked my trinity setting and nothing seems out of ordinary.