After changing the function to this
```python
    def load_all_provider_vms(self):
        if not self._on_detail_page():
            sel.force_navigate('infrastructure_provider', context={'provider': self})
        details_page.infoblock.element("Relationships", "VMs").click()
```

It worked without a problem, although, I couldn't trigger the original error. The function should navigate to the right page first before it is used, else there is a dependency expectation which we are trying to avoid.