My flow runs perfectly in attended mode but fails in unattended mode depending on how many actions I have added.
The flow will work in unattended mode but will fail on the second action if I surpass a certain number of actions within the flow.

This is the screenshot of my flow. It will run properly in this state but will fail at the second action if i enable the rest of the actions.
This is the error I get (on the second action of the flow) :
"
Failed to run flow
Problem while executing action 'Click'. Double click failed (error while clicking)
Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK.ActionException: Double click failed (error while clicking) ---> System.Exception: Some simulated input commands were not sent successfully. The most common reason for this happening are the security features of Windows including User Interface Privacy Isolation (UIPI). Your application can only send commands to applications of the same or lower elevation. Similarly certain commands are restricted to Accessibility/UIAutomation applications. Refer to the project home page and the code samples for more information.
at WindowsInput.WindowsInputMessageDispatcher.DispatchInput(INPUT[] inputs)
at WindowsInput.MouseSimulator.MoveMouseToPositionOnVirtualDesktop(Double absoluteX, Double absoluteY)
at Microsoft.Flow.RPA.Desktop.UIAutomation.DesktopCore.InputSimulator.MouseSimulatorProxyBase.MoveMouseToPosition(Point point)
at Microsoft.Flow.RPA.Desktop.UIAutomation.Plugin.UI.UISpecialElements.UIRoot.ClickOnDesktopIcons(String selector, MouseClickTypeEnum clickType)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.AutomationRuntimes.UIAutomationRuntimeBase.UseDesktop(String selector, Int32 clickType, Boolean leftClickOnQuickLaunchBarShouldCreateNewApp, UIATypeEnum UIAType, RectangleEdgePointEnum rectangleEdgePoint, Int32 offsetX, Int32 offsetY)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Proxy.LocalAutomationRuntime.UseDesktop(UIRuntimeElement element, Int32 clickType, Boolean leftClickOnQuickLaunchBarShouldCreateNewApp, RectangleEdgePointEnum rectangleEdgePoint, Int32 offsetX, Int32 offsetY)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Proxy.LocalAutomationRuntime.ClickElementInWindow(UIRuntimeElement element, Int32 offsetX, Int32 offsetY, Int32 clickType, Int32 elementRectangleSubsector)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Proxy.UIAutomationRuntimeRouter.Invoke(MethodInfo targetMethod, Object[] args)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Reflection.DispatchProxyGenerator.Invoke(Object[] args)
--- End of remote exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Proxy.RemoteAutomationRuntimeProxy.Invoke(MethodInfo targetMethod, Object[] args)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Reflection.DispatchProxyGenerator.Invoke(Object[] args)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Actions.ClickElementInWindow.<Execute>b__21_0(IAutomationRuntime r, UIRuntimeElement e)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.UIAutomationActionBase.PerformAutomation(Action`2 action, UIControl control, Boolean logAction)
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Actions.ClickElementInWindow.Execute(ActionContext context)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Actions.ClickElementInWindow.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)
"