There's one catch with that.
Bayer image can be 100% correctly demosaiced only when image spatial frequency (is that right term?) is less than Nyquist frequency for every single color channel (and there is no noise present). This approcah involves using AA filter (lowpass for spatial frequencies) and killing pixel-level details (high frequencies) with that.
It only needs to be less than the sensor's Nyquist frequency, not for each individual colour, and nothing is ever 100% exact anyway.
Of course there exist algorithms, decoding/interpolating Bayer images, containing higher spatial frequencies too. This is usable in MF and other bigger sensor cameras without AA filter, where introduced pixel-level artifacts and aliasing are almost invisible due to the big pixel count.
Higher spatial frequencies need a higher resolution sensor. Medium format is now at 60 megapixels. It's also not cheap.
But I've yet to see universal foolproof algorithm to demosaic such 'aliasing affected' Bayer images. Some raw decoders allow change algorithms and/or adjust their parameters - for different kind of images demosaicing results differ greatly.
There isn't a single algorithm for anything. The better Bayer algorithms are adaptive, which is a good thing.