You need to make each product which appears to be duplicate different or choose the more relevant page to be the canonical.
The other thing which can cause issues is if multiple URLs go to the same page, even tracking can cause this.
The thing to ensure is all pages have a canonical which points to the most relevant content.