Yeah, I'm aware of this behavior, which is simply a result of the same rule you mention. (It's intended and not a bug, but it could be addressed--I'll get to that.)
The robots are tracking you down, and they have a path to your position, and as you're aware when out of sight they are allowed to edge past their allies to the next unoccupied spot, regardless of where that spot is located. This is to prevent the many possible bottleneck situations that can cause big swarms of robots to form. In this case that Grunt was out of sight and its intended path passed through the Recycler and your current position to end at your old position, and once you moved out of that old position, it's allowed to jump both the Recycler and you.
Honestly the solution here might be more deadly than you like--what if doorways no longer worked as bottlenecks? Instead, attacking squads will properly squeeze their way into a room and surround you, which is the obvious logical thing for them to do, but allowing this is likely to make the game that much more difficult since there will be even fewer defensible positions.