RE: You need a Microsoft Dynamics 365 license to continue
Please consider to use "DevTools" (F12) -> Network feature or Fiddler tool to get more details of failure.
Most like the message about license is not regarding the user executing the merge who has an eligible license, but other user called during this merge process who has no license anymore .
+ Sample of trace available when using Network feature from "DevTools" (F12):
{error: {code: "0x8004d24b",…}} error: {code: "0x8004d24b",…} @Microsoft.PowerApps.CDS.ErrorDetails.ApiActivityIdKey: "<removed>" @Microsoft.PowerApps.CDS.ErrorDetails.ApiDepthKey: "1" @Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionCategory: "ClientError" @Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionHttpStatusCode: "400" @Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionMessageName: "UserNotAssignedLicense" @Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionSourceKey: "Step/Microsoft.Crm.Extensibility.ImageRetrievalStep" @Microsoft.PowerApps.CDS.ErrorDetails.ApiPluginSolutionNameKey: "System" @Microsoft.PowerApps.CDS.ErrorDetails.ApiStepKey: "<removed>" @Microsoft.PowerApps.CDS.ErrorDetails.ApiStepSolutionNameKey: "System" @Microsoft.PowerApps.CDS.HelpLink: "">go.microsoft.com/.../ @Microsoft.PowerApps.CDS.InnerError.Message: "The user with SystemUserId="<removed>" in OrganizationContext="<removed>" is not licensed, and its SystemUserAccessMode=0 is not either of (NonInteractive=4, SetupUser=1)" code: "0x8004d24b" message: "The user with SystemUserId="<removed>" in OrganizationContext="<removed>" is not licensed, and its SystemUserAccessMode=0 is not either of (NonInteractive=4, SetupUser=1)"
+ Based on above, you can check who is the "SystemUserId" mentioned and confirm if there is a valid license assigned or not.
+ In addition to that, you can identify which are the processes that the mentioned user are owner (workflows, Flows, actions, plug-ins, SLAs...) and reassign to a valid user.
Finally, you can also leverage the option 'Reassign all records' available in the user's record in User entity, and assign all the records for a valid user.