I've had the same problem with my Bosch sander, which has otherwise been a great tool I've had for many years.
The rubber gasket actually doesn't hold the dust cannister on. There are a number of little nibs on the stem of the dust port that fit into a groove in the cannister. About half of the nibs had worn off on my sander. I used some epoxy to beef up the worn out nibs, and now it's good as new, nice solid connection!