There are a few screwy things about this part of the movie. Firstly, why the heck does the assassin use such a bizarre method as poisonous centipede-things? Surely if it's that easy to sneak a droid close enough to dump something right through the bedroom window of a heavily guarded Senator you want to kill, it would make sense to use something a little more... I don't know... deadly?
And then once the deed is done, why does the droid return to the assassin, in doing so providing a convenient trail for any investigators to follow? Wouldn't it make sense to pack the entire droid with enough C-4 to make the MythBusters green with envy and detonate the entire thing right next to where the Senator is sleeping? So as to provide as few clues as possible? (And, like, actually kill the Senator?)
Not that the assassin is entirely to blame here. Wasn't Obi-Wan, in the movie, not two scenes ago telling Anakin off for being rash and saying they were there to protect Senator Amidala, not race off on some half-assed investigation? And what does he do when there is a threat? Leaps through a window to chase down a droid, leaving the Senator behind with no protection but an overly impulsive Padawan and a droid mechanic! (And some handmaidens and Captain Typho, who completely failed to secure the building against... oh... droids with potentially deadly cargoes who can just fly right up to the Senator's bedroom, without even being sneaky.)
Make it the actions of a GM and a bunch of gamers and, as many things about this movie, it all starts to make a lot more sense.
Padmé: Cool, a chase! I'll drive!
GM: Anakin's already in hot pursuit.
Padmé: That's my car! Come back and pick me up!
Anakin: You need to stay there where it's safe.
R2-D2: Yeah. ''I'll'' protect you.
Padmé: ... Why would I need protecting?
Obi-Wan: Cutting back to the chase: Can I see where the droid is headed?
GM: What makes you think it's headed anywhere in particular?
Obi-Wan: Well any sensible assassin would have had it drop a grenade into the room, not a couple of centipedes.
Obi-Wan: And then the droid would have self-destructed so as to provide no clues.
Obi-Wan: So whoever's behind this obviously hasn't thought it through, and the droid is probably returning to them.
GM: You see a masked figure on a ledge near a billboard.
GM: It fires at you.
Anakin: Your problem, master, is you're too easy a target.