Today one of my colleagues was trying to create a list item in SharePoint Online using the PnP PowerShell.
Adding an item to a list
He was running the following command
Add-PnPListItem -List $dlist -Values @{"Title" = "$webTitle"}
and got the following error:
Add-PnPListItem : The object is used in the context different from the one associated with the object.
At line:4 char:5
+ Add-SPOListItem -List $dlist -Values @{"Title" = "$webTitle"}
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Add-SPOListItem], InvalidOperationException
+ FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Lists.AddListItem
The -web switch
I noticed that the -web switch was missing
Add-PnPListItem -List $dlist -Values @{"Title" = "$webTitle"} -Web $web
So what happened?
When -Web is missing in PnP PowerShell Cmdlets the root site will be assumed as the site to be used.
Therefore Add-PnPListitem will run on the root site while the list specified lives in a sub site. This problem can also be avoid by running the connect cmdlet and specify the sub site as your connected site.

I also experienced this issue when trying to add list-item with managed metadata column that allows multiple values.