[FrameworkBundle] fixed circular reference for service templating (closes #6730, closes #6762)