Despite the growing number of heritage language (HL) learners in language courses, the interaction between second language (L2) and HL learners has not been fully explored in the research, and thus, it still remains unclear whether mixed (L2-HL) or matched (L2-L2, HL-HL) dyads are more beneficial for language learning. This study investigates whether the three possible dyad types differ in terms of the form-focused episodes (FFEs) that arose while learners worked together, as well as learning gains as a result of the interaction. Research questions were addressed by analyzing the audio-recorded interactions of eight L2-L2, eight HL-HL, and eight L2-HL dyads engaged in a collaborative writing task, as well as the texts produced by the learners. Learning gains were assessed through the incorporation of linguistic information from FFEs in immediate and two-week delayed post-treatment individual writing tasks. There were no differences regarding the total number of FFEs, but dyads differed with respect to the linguistic focus and resolution of FFEs. Moreover, learning gains were greater for matched dyads than for mixed dyads, suggesting that working with a peer of similar linguistic background and proficiency might be more beneficial for both L2 and HL learners.