Foreman Proxy is not getting updated with the new puppet environment and resulting in internal server 500 error

Problem:
Innternal server 500 error after syncing smart proxy
Expected outcome:
should be synced without error
Foreman and Proxy versions:
1.22.2
Foreman and Proxy plugin versions:
1.22.2
Distribution and version:
centos 7.8 and core-4.1-amd64:core-4.1-noarch
Other relevant data:

logs are not missing