Post the rest of the script?
 Hey Ian.  Large script and would prefer not to post everything.  Here is what I believe to be pertinent tho... 
def get_Coordinates():
    #Create SQL statement
    where_clause_envelope =  "\"{}\" = '{}'" "or " "\"{}\" = '{}'".format(Field,originValue,Field,destValue)#produces: "Name" = 'Amarillo 34th St'or "Name" = 'Coulter
    #Create temp layer for origin and destination
    Ends = arcpy.MakeFeatureLayer_management(subs, "Ends", where_clause_envelope)
    fields = ["SHAPE@X","SHAPE@Y"]
    cursor = arcpy.da.SearchCursor(Ends, fields)
    record1 = next(cursor)
    record2 = next(cursor)
    x1 = record1[0]
    x2 = record2[0]
    y1 = record1[1]
    y2 = record2[1]
    pointList = [arcpy.Point(x1, y1),
         arcpy.Point(x2,y2)]
    return pointList
def get_costRaster(count):
    return os.path.join(savepath  + "\\Scratch.gdb"  + "\\cost_Raster_" + str(count))
...
savepath = r"G:\Xcel\Route Tool\Southwest\AMA_S_2_PD"
End_Raster =  os.path.join(savepath  + "\\Scratch.gdb"  + "\\End_Raster_" + str(count))
# The following inputs are layers or table views: "dist_Raster_0"
outPointExtract = ExtractByPoints(get_costRaster(count),pointList,"INSIDE")
outPointExtract.save(End_Raster)