Could try to use GetFileByUrl to resolve the issue. Please refer to following script
$credential = Get-Credential
Connect-PnPOnline –Url "https://contoso.sharepoint.com" –Credentials $credential
$ctx = Get-PnPContext
$web = Get-PnPWeb
Write-Host "Web: " $web.Url
$item = $web.GetFileByUrl("https://<tenant>.sharepoint.com/:w:/r/sites/<site url>......")
$ctx.Load($item)
$ctx.ExecuteQuery()
Write-Host "Item:" $item.Name
$ctx = $null
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.