I have a model that runs a script I get an error that states a field does not exist. Once the join happens they filed should exist, and looking at the outputs the join doesn't happend. I can run the stand alone script and also run the model and it runs fine. When run the model in Pro scheduler I run into is issue. I have tried adding a a derived output parameter and still no launch when I run it out of Pro Scheduler.
join = arcpy.AddJoin_management("Lyr1","ACC_ID",table1, "ACC_ID", "KEEP_COMMON")
arcpy.SetParameterAsText(1,join)
arcpy.FeatureClassToFeatureClass_conversion("Lyr1", "C:/Temp/test.gdb", "BP_TestA")
Couldn't figure out why this happened, I ended up using arcpy.management.JoinField instead of arcpy.AddJoin_management. Also, I didn't have to use a derived output parameter once I used the arcpy.management.JoinField.