More details if you need them for debugging cargo cloaking: I had removed all the cloaking modules to put them in the shield, the illegal cargo was a small number of slaves (<10) that I got from fighting slaver ships. I'm going to reload that save and see if it happens again.
I tried to replicate it - I made sure that I don't have any cloaking modules and did a lot of aimless travel to trigger an encounter with the police, but this time they did find the illegal cargo, confiscated it and fined me. No changes to my reputation, though, or at least no notification about it. I wonder what happened the first time.