The Id
column in your subquery is the Id
of the PricebookEntry
object. You want the reference field to Product2
, Product2Id
:
SELECT Id, ProductCode
FROM Product2
WHERE Id NOT IN (SELECT Product2Id
FROM PricebookEntry
WHERE Pricebook2Pricebook2Id = '01si0000003vpAlAAI')
My first stop with this kind of issue is always the field reference for PricebookEntry
(or whichever sObject is in question). It's a great resource for not just names but specific requirements and limitations around each standard field.