Hello Aram,
You are creating the certificate request and local.pse in the same command, you can seperate them out by issuing two commands ( refer https://websmp106.sap-ag.de/saprouter-sncdoc)
The first command will create the local.pse and the second will create a certificate request from local.pse, try this method to isolate the issue.
sapgenpse get_pse -v -noreq -p local.pse "<Distinguished Name>"
sapgenpse get_pse -v -onlyreq -r certreq -p local.pse
If you can get sapgenpse to create the local.pse then 50% of your work is done, we can then concentrate on creating the certificate request.
Regards,
Siddhesh