Where did I make a mistake in my simplification of the algebraic expression?
There is no mistake, simply note that $$\frac{2(1+xy^{-1})}{x^{-1}+y^{-1}}=\frac{2x(x^{-1}+y^{-1})}{x^{-1}+y^{-1}}=2x$$
I don't believe you have made a mistake. Multiply the numerator and denominator by $xy$ and you should be able to see how it simplifies from there.