Yes, a consumer-level camera sensor uses Bayer filtering, but that's just an implementation detail just like the rods and cones inside the retina - you don't perceive each channel individually after all, lest you wouldn't be able to perceive "brown" or "pink".
So any analogy between CCD sensor output and human eyes ends right there.
The difference lies in the output of the sensory mechanism (be that human eyes or CCD sensors). While consumer level hardware outputs multichannel images (yes, by means of subpixels and Bayer filtering, but that's irrelevant - for the sake of argument it could as well be pixies), scientific instruments use separate CCD sensors for each recorded channel to a) keep the full resolution and b) avoid cross-talk between different frequency bands , which is unavoidable with the subpixel setup used in commodity hardware.
So while your smartphone or DSLR's RAW output will be a multichannel image, instruments onboard of spacecraft will only ever output a single channel per sensor. No subpixels, no Bayer filters. Either one dedicated sensor per recorded channel (e.g. HST WF/PC2 camera) or multiple images taken in series using a single sensor but multiple filters (e.g. cameras onboard MER and MSL rovers).
I hope that was a little clearer.
What's the correct colour channel to use for for near UV (yes, I know that some people - mainly women - can perceive that, but the vast majority of people can't)? What matches near IR or even X-rays? How would you colourise the frequency bands that match different elements (those include very narrow bandpass filters) but don't really make sense in terms of RGB?
That's the difference right there. If you have a picture that uses channels of different filter bands that correspond to hydrogen bands, organic molecules or UV radiation, none of that data correlates to human colour perception. So someone just chose shades of green for hydrogen or shades of blue for organics.
So what I'm trying to say is that the underlying mechanism is irrelevant - the data simply isn't colour data as seen by humans.
The different bands received from spacecraft, rovers and (space-)telescopes are matched with red, green and blue, even though they're actually taken in near infrared, UV, or even X-ray spectra.
The "truth" is that the images are only monochrome representations of recorded photons of different energies. Most people don't see near UV light for example and some images are taken in very narrow bands and then "stretched" into "full" RGB, etc.
The point is that the recorded data doesn't correspond to the human vision apparatus (or at least not well) an thus any multi-colour representations are necessarily fabricated and sometimes don't even try to reflect what a human would have seen.