Sunny,
This looks like a license error (see the line that says "Image Server is not supported with the current license. Failed to execute Flow Direction."). I don't know why ImageServer would be necessary here. In ArcGIS Pro, you only need the Spatial Analyst license due to the hydrology tools used in this script. Can you confirm that you have Spatial Analyst licensed and enabled?
If you lack the proper licenses, you can look into the equivalent open-source
WRF-Hydro GIS Pre-processing tools, which are python command-line tools that will perform the same functions using different, open-source GIS libraries.
Cheers,
Kevin