Hi @muhammad masood,
Apologize for the late reply. It took me a while to replicate your situation and test it on my end.
However, on my end the workflow successfully creates the file with the 2ndary CT as the template and the file customization properties work fine.

However, we can work together to narrow down and resolve the situation. So, Please kindly provide more information below to let us work further.
1.Maybe the workflow is configured successfully, and you can find the custom document properties from Quick Parts->Field->DocProperty.
2.Whether all SharePoint libraries have the same problem? You could create a new Primary CT library and a new 2ndary CT library to run the workflow again.
3.Are other users facing the same problem? Ask your colleague to recreate the workflow on another computer.
4.You can try to use SharePoint 2010 workflow, I have tested it on my side, and it works as well.
5.You could try to clear browser cache then restart it.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.