I want a protagonist to have to take over raising a friend's baby for ~ 2 years, fully knowing they will have the child for a long time. I want the friend to have chosen the protagonist to care for the child, potentially done up guardianship paperwork etc. During this time the parent should have very limited, if any, physical contact with the child, video chats or long distance communication is more acceptable. This is set in modern setting.
There are plenty of scenarios to make this happen, but I want one where the parent of the child is seen as a good loving parent that the audience should feel is ready to take back care of the child when the time comes to take them back. That rules out any answer such as the parent simply feeling incapable of caring for the child. While I stress I do not judge anyone in any these situations myself in interest of getting the best audience response I'd also like to rule out such things as prison time, drug rehap, or even just struggling to financially care for a child.
I might be willing to have the parent need to go get some sort of treatment for a health condition so long it's one with a predictable treatment time, ie the protagonist knows they have the child for years, there is a good reason the parent can't see the child in person during that time, and the parent is expected to be fully functional/healed after the treatment is over; though frankly given all the convoluted handwaves to set that up I'm not sure I like the health treatment option..
So why would a loving parent choose to give up most contact of their child for their formative years?