Is it correct when using FeatureSetByName the layer must be in a featureservice (not a map service) and must be the only layer in the service?
That is not correct. You can work with map services, but to have full functionality you will need to add each layer separately. Take a look at the sample service of the USA:
It is a Map Service with 4 layer:
If you add the service to AGOL using the URL "https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer " it will be added as a group layer and functionality will be limited to only the attributes of the current feature.
When you add then individually adding "/0" for the Cities and "/3" for the Counties, you can use Arcade normally to extract the county name for the city like this:
return First(Intersects($feature, FeatureSetByName($map,"USA - Counties"))).name;
Which will appear in the pop-up:
Retrieving data ...