When we moved to a new location in 2015, we had this same type of issue for over a year. After checking all internal connections, and exhausting all other possibilities, I had Comcast come out and they discovered the line from the pole to the house and the associated connections were all bad. They replaced all of it. Then they also asked to go inside the house and check out the internal connections as well, but found no issues. After that, the service was great. But of course, since Comcast can never leave any customer with a totally positive experience, they tried to charge me $300 for the service call (even though all issues were outside the house) which after contacting and filing a complaint with the FCC, they finally dropped. It's ALWAYS a battle with theses people!
When we moved again in 2020, before we even moved in, I had them come out and check the incoming line which was underground and they found it needed to be replaced. They replaced the underground line and associated connections and all has been good so far. This time they did not try to charge me for it.