You’re right, he’s a mad scientist, but even scientists have limits to what they can achieve with their knowledge. For every move Pernida makes, Mayuri is somehow able to quickly pull out something from his sleeve to counter Pernida’s abilities. A great example of that is how Mayuri was able to swiftly reconfigure the rearrangement of his nerves to prevent Pernida from controlling him. You can explain this through “science” if you like, but that was just a random, illogical made by Kubo, especially if you consider the timeframe Mayuri had to do it in. Now, he has an altered bankai that can adjust accordingly to different battle conditions. How convenient.