Access Denied while running the task by Windows Task Scheduler

Getting Access denied error while running UiPath through task scheduler.
UiRobot 22.4.3.0
RemoteException wrapping System.ComponentModel.Win32Exception: Access is denied.
at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited)
at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)
at System.Diagnostics.Process.GetOrOpenProcessHandle()
at System.Diagnostics.Process.EnsureWatchingForExit()
at System.Diagnostics.Process.set_EnableRaisingEvents(Boolean value)
at UiPath.Service.UserHost.AttendedServiceProxy.RegisterClientProcess(Int32 clientPid)
at UiPath.Service.UserHost.StudioOperations.Prepare(ClientProcessMessage message, CancellationToken ct)
at UiPath.Service.UserHost.StudioOperations.GetFeeds(StudioAgentMessage args)
at UiPath.CoreIpc.Server.<>c__DisplayClass7_3.<<-ctor>g__InvokeMethod|6>d.MoveNext()
— End of stack trace from previous location —
at UiPath.CoreIpc.Server.<>c__DisplayClass7_1.<<-ctor>g__HandleRequest|3>d.MoveNext()
— End of stack trace from previous location —
at UiPath.CoreIpc.Server.<>c__DisplayClass7_2.<<-ctor>b__5>d.MoveNext()
— End of stack trace from previous location —
at UiPath.CoreIpc.Helpers.Timeout[TResult](TimeSpan timeout, List1 cancellationTokens, Func2 func, String message, Func`2 exceptionHandler), HResult -2146233088