I can provide you a short snippet, but actually, it fails already at the 1st line !!!!
Therefor it doesn't matter whether I call it from ArcGIS Pro, or outside.
Because it's a "quick-and-dirty" script, lot's of stuff is hard coded, and changed for each run.
# start of my script -> fails at this 1st line already
import arcpy
import os
import manageTables
import readProperties
# Option 1 : Get parameters from ArcGIS Pro toolbox
# inputProject = arcpy.GetParameterAsText(0)
# outputFolder = arcpy.GetParameterAsText(1)
# Option 2 : Get parameters hard coded
inputProject = r"Path/to/my/input/file"
outputFolder = r"Path/to/my/output/folder"