Rebuild api not working in Foreman v2.1

Problem:
When I’m hitting the foreman v2.1 rebuild api ( PUT /api/hosts/:id/rebuild_config) through php script I’m 422 http code not 200 http code. This rebuild foreman functionality was working v1.20 but not v2.1. Getting below response from the api
{“message”:“Configuration rebuild failed for: SSH_Nic and SSH_Host.”}

Please guide me how to fix this issue.
Expected outcome:
200
Foreman and Proxy versions:

Foreman and Proxy plugin versions:

Distribution and version:

Other relevant data: