Here is the way I see it... and it took me a bit to figure this out in my mind...
1. The disarming of a person during a stop which is made with RAS is a fact that we are going to have to accept because the US Supreme Court has said so. IF a cop has the RAS to detain you, they have the right to disarm you during the detainment, "for officer safety." So, the first question is, was there RAS for a stop? The answer is yes, the person committed a traffic offense observed or measured (radar) by the officer. Was the presence of a weapon reasonably suspected by the officer? The answer is yes, the person told him he had a gun. Therefore, was the officer within his rights to disarm the person under the guise of "officer safety?" The answer is yes, because the US Supreme Court has said so.
2. HOWEVER, at this point in the story is where things went wrong. IF the officer was truly concerned about his safety, the proper action would have been for the officer to ask the subject to step out of the vehicle and disarm him outside the vehicle. The fact that the officer took no immediate action regarding his own safety in that he left the subject in the car, and walked around the vehicle to the passenger side and then placed himself in a position of limited mobility by leaning and reaching into the vehicle highly suggests that the officer had no concern for his own safety, and thus, it could be logically deduced that the disarming was not "for officer safety".
3. Then the question of did the officer check the serial number of the gun against a stolen list? That is totally and completely beyond the scope of a search and seizure for officer safety. The officer had absolutely no indication that gun might be stolen, and at that point, also running the serial number of the gun would give no additional evidence nor protect evidence already gathered for the traffic stop. So the actions of running the serial number would be completely unjustified and against the 4th Amendment.
4. Then the return of the weapon to the trunk of the car? How did the officer gain entry to the trunk? Certainly the officer can ask the subject if he can place it there, but cannot demand it.
So, if I were the OP, at the scene I would have complied with all the officer's requests up to the point of asking to put the gun in the trunk. At that point, I probably would have refused his entry. My trunk is usually completely empty, but it's the principle. Then, because of the nature of the officer's actions after he found out I was armed, I would do a FOIA request, find out if the officer ran the serial number of the gun, and filed a formal complaint that the actions of the officer were either very obviously conducted solely for the purpose of obtaining the serial number of the gun, or the officer was just incredibly untrained and/or stupid in his method of disarming.