Hello,
I am trying to use some arcpy tools in Jupyter Notebooks but it doesn't appear as though I can use a FeatureLayer object as an input. Here is an example.
I obtain my feature layer by getting the feature collection using the item id and then calling the first (and only in this case) layer. This returns a FeatureLayer object. I can easily find the fields as follows:

However, when I use the arcpy equivalent function it tells me that
OSError: "<FeatureLayer url:"https://services8.arcgis.com/.../FeatureServer/0">" does not exist"
even though it actually does.

Interestingly when I pass the FeatureLayer object's URL in it works.

Can someone explain why I can't use the FeatureLayer object directly or what the difference is?
Many thanks.