This not a thing that can happen. Cameras just don't work that way. For that matter, light doesn't work that way.
Specifically, for digital cameras: every "photosite" — each individual pixel-level sensor — is just a counter of photons. It doesn't have any sense of the wavelength of the light received, and correspondingly no perception of color. In order to make a color image from this, the photosites are covered in a pattern of red, green, and blue filters, allowing only certain wavelengths to be measured by certain sensors. This data is then constructed into a color image. (Some sensors are a little bit different, but this is the vast majority, and the same principles apply.)
In order for this image to be black and white only, these sensors would need to record an exactly equal amount in each channel (red, green, blue). But the only way to do that is for there to... actually be that. I'm oversimplifying a bit (white balance, device color spaces, tone curves, and so on make this not completely true), but no matter what, you can't force a certain false color (grayscale or otherwise).
The perception of color in cameras is actually reasonably analogous to the way our eyes perceive color — and not by accident: color itself is a construct of the way our eyes work and not something inherent in nature; consider that there is no wavelength of light that corresponds to "purple"). Because of this, it's basically the case that if it looks a certain way to the eye, a camera can get reasonably close. The match isn't perfect, and as photographers we spend a lot of time struggling to overcome that gap and get the color rendition to match what we think it should be based on our perception — but that's entirely a matter of taking an image which contains data that can interpreted as many different colors — it's impossible to force an image to somehow pick up exactly what you want it to be, and doubly impossible when you want it to be something different than what it actually is.