Agreed that's the way it's supposed to work, but "woulda, coulda, shoulda" are ideals, and reality sometimes comes up short.
In two traffic stops and a B&E into my home, I was asked to unload and relinquish all three times. They were almost apologetic about it, and after we finished our business, they returned my firearm and the magazine saying, "Please wait until we're gone before you reload it."
I did, and that was that.
I can understand the two roadside disarmings, but the one in my own home was all the way in the back, in my bedroom. What the hell? We were in the front hall. There was absolutely no need whatsoever for that. I came about this close to telling them, "You know what? I think we're done here. Please leave. Now." The only reason I didn't is because I have a good working relationship with the PD and didn't want to jeopardize that.