Congrats on a beautiful synth! one of my favourite digitals (hence my avatar
If it's the same key that shows a problem, it's usually related to the electronics more than cleaning of course. This could be either the gate array chip (reads the key matrix) - had that prob on a Juno 2! - or could be something simple like a bad wire/connection on the cable. Firs thing would be to open it up and check cable is plugged in properly and that it's not got a dodgy wire or two (there will be 2 lots as it's velocity sensitive) and sounds like one for all the B keys is shorted or disconnected (or heat is making it disconnect) and the other (+ octave ground) is for note on/off. Easier to look at and test than to describe.
Tiny solder traces can cause shorts on the 'scan board' and there's a cable runs to the mainboard - check it's clear of fouling and has it's shielding in place
Really though first thing is to check it's all physically OK inside connectors and cables. Then to look into more detail at the specific wire for the keys in the matrix - easy to fix if so. Lastly it could be a damaged gate array/key reader chip - and it may be surface mounted like Juno 2 which is next to impossible to fix on your own cos such small pins for de soldering.
Try it over midi if you can see if all notes play ok - can help diagnosing - if it's ok then it's def a problem from the key reader IC back to the keybed wiring.
Oh also dismantle the keybed - clean the keys while at it to make it like new
- and check the keyboard PCB (where all the contacts are) for broken tracks - one further down the line may affect all the keys on that line if intermittent maybe not though http://home.arcor.de/richardon/richy2001/d50/sch4.gif
See a schematic there - to dyna scan board - this is what you'll want to check - the entire thing connections, shorts etc
You can download the full service manual off the net
Hopefully just a lose cable though
BTW i fixed 2 buttons that weren't working on my d-50 by carefully dismantling the tiny tact switch and cleaning it. You would typically just solder a new switch in though (cheap and easy if you can do it)