Which potion system you were using? Old or new?
Also sometimes char stays online because cipsoft sucks.
Also keep in mind that fast hits (fast decreasing of hp) from monsters could skip the potions system and activate logout instantly.
For example:
My hp is 100%, my potions system usage is set to 40%, my logout percentage is at 20%.
Monster hit me with a big damage and my hp went down to 20% instantly.
BOT logged out, because hp is at ~20%.
- Character stayed online because of cipsoft servers bug and died.
- Or monster was powerful enough to deal another damage at the same moment while bot was logging out from the game.