Resolution Summary:
-->Initially used OAuth to connect Logic App to a VM, but the connection failed due to token expiry and tenant mismatch issues.
-->Switched the Logic App to use Managed Identity instead of OAuth.
-->Enabled System-assigned Managed Identity on the Logic App.
-->Assigned the "Virtual Machine Contributor" role to the Logic App’s Managed Identity at the resource group level.
-->After the role assignment, the Logic App was able to successfully list the subscription, resource group, and VM in the dropdowns.
-->Everything is now working as expected using Managed Identity.
Please do not forget to click "Accept the answer” and Yes
wherever the information provided helps you, this can be beneficial to other community members.