Nested cursors can cause a bad time. lines 28 and 29- are they on the right indent level? As is, they are outside of the cursor 2 scope and once the for y in cursor2 loop completes, y[1] shouldn't exist.
I'd recommend building a dictionary of objectid's from the first cursor, and then iterate over the dictionary to perform the select by location.
Is that second cursor just to get the wNummer? The expression in the ExportReportToPDF is using the OBJECTID of the first cursor, so its not picking up/using the OBJECTID of the second cursor, if that is your intention. Could need a new sql query using OBJECTIDS from the second featureclass? Maybe something like:
arcpy.management.MakeFeatureLayer(ZwolleOpdracht, 'ZwolleOpdrachtTemp')
queryLekindicatie = f"""{arcpy.AddFieldDelimiters(ZwolleLekindicatie, 'Status')} <> 'Verwerkt'"""
# create dictionary of objectids and other fields from first featureclass
feat_dict = {x[0]: {'OBJECTID': x[0], 'Status': x[1]} for x in arcpy.da.SearchCursor(ZwolleLekindicatie, ["OBJECTID", "Status"], queryLekindicatie)}
# iterate over the dictionary to select by location from other featureclass
for k, v in feat_dict.items():
queryLekindicatieTemp = f"""{arcpy.AddFieldDelimiters(ZwolleLekindicatie, 'OBJECTID')} = {v['OBJECTID']} """
print(f"OBJECTID: {k}\t status: {v['Status']}\t queryLekindicatieTemp: {queryLekindicatieTemp}")
arcpy.management.MakeFeatureLayer(ZwolleLekindicatie, f"ZwolleLekindicatieTemp{v['OBJECTID']}", queryLekindicatieTemp)
SelectieWnummer = arcpy.management.SelectLayerByLocation('ZwolleOpdrachtTemp', "WITHIN_A_DISTANCE", f"ZwolleLekindicatieTemp{v['OBJECTID']}", 2, "NEW_SELECTION")
with arcpy.da.SearchCursor(SelectieWnummer, ["OBJECTID", "Opdrachtnummer"]) as cursor2:
objectids = []
out_pdf = None
for y in cursor2:
wNummer = y[1]
print(y[1])
out_pdf = output + r"\{wnummer} Lekindicatie.pdf".format(wnummer=y[1])
objectids.append(y[0])
sql = f"""{'OBJECTID'} IN ({str(objectids)[1:-1]})"""
arcpy.management.ExportReportToPDF(Report, out_pdf, sql, 300, "BEST", "", "", "JPEG")