Unable to fetch metrics from custom metrics API in Rancher v2.5

The issue here turned out to be that this cluster had the following apiservices installed:

kubectl get apiservices | grep -i custom 
v1beta1.custom.metrics.k8s.io           cattle-monitoring-system/rancher-monitoring-prometheus-adapter   True                      80m
v1beta1.external.metrics.k8s.io         custom-metrics/custom-metrics-apiserver                          False (ServiceNotFound)   20d
v1beta2.custom.metrics.k8s.io           custom-metrics/custom-metrics-apiserver                          False (ServiceNotFound)   20d

I removed v1beta1.external.metrics.k8s.io and custom metrics started working correctly.