Facing an issue with upstreams, with a service path included on a service record

Facing an issue with Upstreams, with a service path included on a Service record
Description,
Services,
service: A, path:/api/v1 > host: abc.api.com
routes,
route: /abc/ (service: A)
Created 3 upstreams,
upstream: abc.api.com > target: h1.dev.com:8080
upstream: h1.dev.com > target: h1.dev.com:8443 (kong proxy port 8443 ssl)
upstream: h2.dev.com > target: h2.dev.com:8443 (kong proxy port 8443 ssl)
Kong Hybrid mode,
Data plane1: h1.dev.com:8443, service: A deployed here on http port 8080 (h1.dev.com:8080)
Data plane2: h2.dev.com:8443

Based on the incoming request collecting the route path and the host name if both are matching with the data.json of OPA(Open policy agent) we are returning the upstream name(abc.api.com) else returning the domain name(h1.dev.com) as the upstream name with which we would have created the upstream on kong

Sample incoming request, https://h1.dev.com:8443/abc/123  based on the below data.json it goes to first block due to the path /abc after the evaluation as the path and the incoming request host names are matching we are returning upstream "abc.api.com"
And if the incoming request is, https://h2.dev.com:8443/abc/123  based on the below data.json it goes to first block again and as the host name is not matching with the domain name. we are returning the domain name "h1.dev.com" instead of returning the upstream name. So that when it goes to the upstream "h1.dev.com" and the request turns out to https://h1.dev.com:8443/abc/123 and when it comes to the below data evaluation it matches and returns the right upstream "abc.api.com".  

Sample data.json
{
	{
		"route": "/abc",
			"clusters": [
			  {
				  "domain": "h1.dev.com",
				  "upstream": "abc.api.com"
			  }
			]
	}
	{
		"route": "/def",
			"clusters": [
			  {
				  "domain": "h2.dev.com",
				  "upstream": "def.api.com"
			  }
			]
	}
}

The above mentioned use case is perfectly working fine with the request as https://h1.dev.com:8443/abc/123 

But, when the request is https://h2.dev.com:8443/abc/123 even though the logic is returning the right upstream name its getting failed with an error response saying 404 - "no Route matched with those values" and when checked the logs I noticed that the service path is not getting prefixed to the request uri in this case.
Appreciate your help in solving this. 

And also noticed that, If we are maintaining the whole path under the route object as {/api/v1/abc/} avoiding the service path. both the above mentioned use-cases are working fine. Its getting failed if we add a service path under the service object.