I found a source that includes the second half which makes it more obvious:
Dr. Macho believes #42’s behavior is intentional and aimed specifically at him. “I caught him laughing at me once while I was trying to sort data he’d fucked up. I know what you’re thinking, ‘Can rats even laugh? And what would it look like?’ Trust me, when a rat laughs at you, you’ll know.”
When asked why he doesn’t simply exchange #42 for a less malicious rat, Dr. Macho explained, “You can’t just use an infinite number of lab rats. They start to think you’re a psycho if you keep asking for more.” Dr. Macho sighed. “I feel like I’m living in an annoying Pixar movie where I’m the bad guy – oh, wait….I’m the bad guy. I’m the evil scientist performing experiments on a sassy, smart rat. And my name is Dr. Stu Macho? Oof, yeah, I’m the wrong one here.”
Just behind Dr. Macho, #42 winked and walked directly into his food bowl.