Similar problem here.
It happens when I connect to my dock, or I play with cable of external monitors. Also when the macbook pro goes to sleep then wake up, it can only detect one monitor. If I plug/unplug the cable of the other monitor, panic happens.