I disassembled that switch as far as I could. Several rattle issues were found incluing the small plastic clear light pipes, for lack of a better term. The little plastic parts that channel light up to the buttons. Those are also loose in there so I pinned them down with some CA Glue and reassembled placing tessa tape everwhere plastic touched plastic. Even did a little sound damping work on the door lock buttons.
I was prepared to do that, but once I put that expanding foam in there, I could shake it, tap it, move it all around, and it didn't make a sound. So far, it's been whisper quiet in the truck. The only noise I notice is when my left knee rides in that area and pushes the door panel a bit, but that's on me to adjust myself LOL.
I also took the overhead console down and did the same thing. I fully disassembled it, and shoved foam up into that sunroof switch, all up inside the housing, and put it back together with foam pieces between the plastic. Once again, not a sound out of it. I am a full on believer in the foam.