While I was watching the bot, it found a shiny, caught it, and when it returned to the overworld, it didn't nothing for like 5seconds, and then got hit by a pokemon. The fight began, the bot did nothing for a while, and then resetted the game. (the bot is set to save after each shiny). It has happened to me a few times over the last few days, I have in my boxes 7 shinies while the bot claims to have caught around twice as much. 
I attached the logs in case it's of any help. For more context, I'm running the shiny hunt autonomous - overworld program for SwSh on route 2.
#SwSh autonomous overworld hunting issue
1 messages · Page 1 of 1 (latest)
Why doesn't Discord like the log?
discord is just super slow to upload it
And where you hunting that makes you get attacked so soon after a battle?
I was hunting on route 2, lakeside
But the bot doesn't get instantly attacked after the battle, there are like 5 seconds where it just stands in the overworld after catching the shiny
That wait is intentional since it's waiting to make sure it's back in the overworld. So it's time-based and not as advanced as the SV bots that literally detect every possible state.
I see
If you can get a log of when it, I can take a look and see what exactly happened.
My guess is that it fails to save the game and panic restarts. But I need to see how before I can handle it.
My internet seems to be against me at the moment, the log file is still uploading 
Looks like there's something wrong that I didn't expect. The overworld bot does actually detect when it returns to the overworld. But it's not working in your case.
Oh, that's odd. Could it be because I'm not in the wild area ?
Shouldn't matter.
It's not detecting the black screen that happens shortly before you return to overworld.
Umm, ok. I have another capture card, does it have any interest to try with a different capture card ?
I pushed a fix for the end of battle detection that's causing it to sit around for 10 seconds doing nothing. That should improve things a bit, but it doesn't fix the issue of getting attacked while it's trying to save.