おすすめで出てきました
おすすめで出てきました means “It came up as a recommendation.” I don’t know how to grammatically explain this usage of で.
おすすめに出てきました
おすすめに出てきました more concretely refers to a place where that thing came up, such as a list or section. It may be translated as “It came up in recommendations.”