I have a K-Line 040 switcher with TMCC the rear coupler opens without my pushing the coupler button on the remote is there a cure for this ? The coupler is not bad mechanically as it stays shut with the leads unplugged from the tender control board. I have reprogrammed the loco twice and it doesn't help.
You did the right thing in determining if the problem is likely electrical or mechanical.
Try adding a 1uf (micro-farad), 50v, non-polarized capacitor across the coupler leads. This should clear up the problem.
Note that this fix is only good for TMCC and early Legacy locomotives with the R2LC or R4LC. Do NOT add the cap on later Legacy locomotives with the RCMC board.
TRW