Creating compute-resource image with CLI not working - with GUI works - vSphere

Hi, I am new to Foreman-Katello. Setup is rocky8.7 for foreman-katello on vSphere 8. I have been trying to sort out this issue from past 4 days but couldn’t find what’s the issue.
When I try to create ‘hammer compute-resource image create …’ I get:
Could not create the image:
Internal Server Error: the server was unable to finish the request. This may be caused by unavailability of some required service, incorrect API call or a server-side bug. There may be more information in the server’s logs.

But the GUI is working fine. I can create the images from Templates in Vmware vSphere 8. Everything is working fine with GUI but CLI is failing.
Can’t create images with hammer CLI

Expected outcome:
create images with CLi
Foreman and Proxy versions:
Foreman 3.5
Foreman and Proxy plugin versions:
Katello 4.7
Distribution and version:

Other relevant data:

2023-04-16T12:38:49 [I|app|6a96e5df] Started POST "/api/compute_resources/1/images" for at 2023-04-16 12:38:49 +0100
2023-04-16T12:38:49 [I|app|6a96e5df] Processing by Api::V2::ImagesController#create as JSON
2023-04-16T12:38:49 [I|app|6a96e5df]   Parameters: {"location_id"=>2, "organization_id"=>1, "image"=>{"name"=>"rocky8_katelloTemp", "username"=>"root", "uuid"=>"503c3b66-e0a8-43da-a23e-2747c029a87b", "password"=>"[FILTERED]", "compute_resource_id"=>"1", "architecture_id"=>"1", "operatingsystem_id"=>1, "user_data"=>false}, "apiv"=>"v2", "compute_resource_id"=>"1"}
2023-04-16T12:38:49 [I|app|6a96e5df] Authorized user admin(Admin User)
2023-04-16T12:38:49 [W|app|6a96e5df] Action failed
2023-04-16T12:38:49 [I|app|6a96e5df] Backtrace for 'Action failed' error (NoMethodError): undefined method `images' for #<Location:0x00007fc599b431b8>