On my car, the socket that the rear bulb goes into is not part of the wiring loom and can be changed. Try swaping the sockets from side to side and see if the problem follows the socket. If it does, replace the socket, or at least have a good hard look at the socket connections.
I had the same problem when my car was nearly new. It turned out to be a bulb with an intermittant problem.