I noticed this post was from 2017 but I'm having similar 401 errors as well.
I'm trying to replace Dialog boxes (which will be obsolete soon) by recreating the functionality in a PowerApp. There's a button on the PowerApp that runs a PowerAutomate flow. The flow will run perfectly fine if I delete all references to CDS connections (using "current environment" connector). If I include CDS connections, it will throw a 401 error.
I've tried clearing cache and restarting browser. I've tried logging off all sessions and relogging back in. I've completely deleted my Flow and rebuilt it. I have other flows that are non-Powerapps-triggered that use the CDS connection--they have no issues.
A Google search shows many resources on 401 errors, but every one of them has a different solution ranging from: changing password, reestablishing connections, recreating flow, logging off and logging back on, turning on some Async mode on PowerApps, etc. I have been working on Flows, Dynamics 365, and PowerApps separately for almost 2 years with no issues; so issue is completely befuddling.