I changed the approach to ModelBuilder with parameters. I first run the created ModelBuilder as tool successfully. Then I published the result as a geoprocessing tool. In Step 3, I run the published geoprocessing tool successfully. This thread is to be closed.