I have been adding the layers from the map service by their rest index number url and that works fine.
Example , /mapservicename/mapserver/3
It takes a few extra minutes but works to get the layers to work in the templates and you don't need separate map services for each layer like I thought back then.
It is a pain when you reorder or add layers to the map service as the agol map needs to be redone too.