It needs to be a dns.edns.Option subclass, not the integer option value. (Options are like rdata in that there's a registry of classes, and while the GenericOption is useful for most things we also have the ECSOption which is useful for the complicated EDNS Client Subnet option.)
q = dns.message.make_query(dns.name.from_text("."), dns.rdatatype.SOA, use_edns=0, options=[dns.edns.GenericOption(dns.edns.OptionType.NSID, b'')])