Currently there is no error message. It produces an excel of the spatialJoin table but it skips the select by attributes part because the join layer is not added to the map. If I add the lines below it, it adds to map and makes the right excel export. But I need to find out how to make that work if I send the tool to someone else.. The path to the layer for makefeaturelayer has to be a parameter set by the user maybe..
lyr =
arcpy.management.MakeFeatureLayer(r"Path_to_Layer\\DropFiber_SpatialJoin", "DropFiber_SpatialJoin").getOutput(0)
maps.addLayer(lyr, 'TOP')
Again, thanks for your help.