The dark side of the JWST (where all the instruments are) will be operating very close to absolute zero and in near-absolute darkness which, of course, is the entire point of the mission.
A selfie camera there would need to function in that environment, while also somehow not polluting the instruments on that side of the camera with heat.
It's surely do-able, but it's a more complex engineering task (and would therefore require more tradeoffs) than operating a camera in the relatively balmy environment of Mars, where heat pollution is of no concern because of the different nature of the mission.
Keep in mind that doing this on the JWST also need to have been accomplished with decades-old technology, given the extremely long design and engineering lifecycle of a complex space mission.
It's only good if you ignore the cost, and look only at the benefits.