I have been trying to remove the Bayer filter from the CCD image sensor of my camera. Now I see there's an IR filter before the lens, however I don't understand the point of it because isn't the Bayer filter going to block out any wavelengths of light that are not in the RGB's range of wavelength?
The Bayer filter passbands are designed to be make the sensor have a reasonable match to the human eye, while not costing too much. They're fairly leaky even in the visible part of their stop band, and pretty much uncontrolled in the IR. To increase their blocking in the IR a more expensive recipe in a thicker layer would be needed. The thicker layer isn't desirable as the evenness of the coating is important and would suffer.
Here (Florida State University) is a typical set of spectra, and you'll see quite a bit of leakage in the IR.
In addition many sensors are used in applications where an IR filter isn't desirable, as well as the more conventional applications. Webcams (for example) typically put the IR filter on the back of the lens, the same sensor is also used in baby monitors when the IR filter is physically moved out of the way and IR LEDs turned on. There was also a Canon DSLR available without the IR filter for astronomy.