@Victor Murphy,
Years ago I was exec of a large service organization housed in a large building. At 2 am one morning, the city cops called to say they found a door open and they couldn't reach the maintenance supervisor. Could I come down to verify everything was okay and secure the building?
I did so and by that time was wide awake. I decided to get on the CB for entertainment and just drive up the interstate for a bit until I got sleepy. So I was chatting with truckers and crusing along when the truckers started reporting a 'smokey' (highway patrol) in the area. About the same time, but unrelated to the smokey reports, I was coming up on a sideroad with a turnaround and took it to head back toward toward.
I became aware of a car coming up close behind me and identified it as the cop. He backed off and followed for a bit and then turned on his lights to pull me over. He asked for license and registration. I had my license but I was driving my husband's company car and did not have the registration. I advised the cop of this and said the car was registered to GAB. He ordered me to get out of the car at that point which I did. He said the car was registered to somebody else, not GAB. (I didn't realize that the car was a lease car and GAB would not have been on the registration.) He said he ran a plate check because I was driving so slowly and made the U-turn right after the smokey reports. He pulled me over because he figured I was drunk.
After I explained who I was and what I was doing out there on the interstate, he decided I didn't look like a car thief and had not been drinking and he let me go. By this time I was pretty annoyed, but I did understand that the guy was just doing his job.
I concur that in your case the cop probably was doing a routine check, inadvertently inputted the wrong number on the plate check, and checked you out when there was no registration indicated. Stuff happens.