It will probably be a permissions problem on the certificate.
When running a unit test you are going to be executing those under your own user context, which (depending on what store the client certificate is in) will have access to that certificate's private key.
However if your WCF service is hosted under IIS, or as a Windows Service it's likely it will be running under a service account (Network Service, Local Service or some other restricted account).
You will need to set the appropriate permissions on the private key to allow that service account access to it. MSDN has the details