Done with the full knowledge and agreement of the mother it is a great solution.
I, very briefly, nursed a baby whose mother was in despair as she wasn't taking her breast. The transition to the mum went smoothly and baby was successfully breastfed.
I also had a friend with a child of the same age as my second. We had a pact that if either of us was in difficulty the other would ensure their baby was fed. Their elder child was bitten by a dog. Mum left baby with me as she took her to A&E. Come feeding time he was screaming and I offered my breast. He latched on eagerly, relaxed, opened his eyes, saw it wasn't mummy and screamed. Fortunately mummy arrived soon after.
I cannot understand why anyone thinks there is anything wrong with the scenario brought up by the OP.