If the sitemap contains 'Not visible individually' products and they are 404, google will give you show a warning with the list of all the 404 pages. Those pages will not be indexed.
This is not a good practice though as it will give you dozens of crawl errors and warnings. Why not filter out those pages from the sitemap?
If you already have product pages indexed and they are 404, they will stay there for a while because Google takes time to remove 404 pages because when many sites crash or have site maintenance, they return 404, so Google wouldn't want to remove pages from their index until they're sure the page is gone.