when u wire the pump direct are u connecting an earth to it ? its possible the motor is developing a fault and tripping the rcd ,thats the first thing i would do , connect the earth to it . Im not sure from you your description if the little black box is a relay or some sort of inline noise supression , if itys a relay ... that could develop a fault , u might be able to google some numbers on it an order a replacment . Also check for the obvious , loose or touching wires , the switch it self ...and dampness .