iOS doesn't have local-only photos. You either put all photos in iCloud, or none (bar iCloud being full).
The point is, I think if Apple decided to scan your photos for CSAM even if you weren't using iCloud, that this would be a distinctly different situation to scanning only the ones uploaded to iCloud.