I have been having a similar problem to yourself, my current partner behaving perfectly for a few days, then going cold, and then after me breaking up with him, another week of the perfect partner. He blames his going hot and cold on his relationship with the mother of his children that ended with total disaster. But, I kept reminding him that he cannot live in the past and he cannot just throw away the chance of happiness because he is scared it will all go wrong again.