Hi Kayden, sorry for the delay, didn't see your message until now. I've had this issue in the past with vector tile layers (possibly from the basemap?) as they have an attribute called "styleUrl" instead of "url", which you could handle with some code like this:
if layer['layerType'] == "VectorTileLayer":
print(layer.styleUrl)
else:
print(layer.url)