This is an example of the custom button url that would be used to redirect a user to the Lightning Edit Modal. We also need to include the backgroundContext URL parameter, so the record page is loaded underneath the window.
Here is an example that references a Case object. The beginning of the URL is standard up to the saveURL2 parameter.
The saveURL2 parameter is an encoded URL that contains [newid] in two spots. These are replaced with the new cloned record id. The backgroundContext URL parameter is double encoded, and this contains what should display behind the Edit modal.
Below is the parameter decoded one time. It’s easier to see the URL of the edit modal page, and the backgroundContext parameter with its encoded value.
Below is the backgroundContext decoded, and we can see the View page url.
To customize this for your environment, you will need to replace a few things in the code.