Hi,
So does autoFetchLegendInfos work only for layers hosted online - and not for .tpk?
Please create a support issue and see if your tpk suppose to show the legend or not. In general Legend only works for the feature layers and dynamic map services and not for the tile layers