From childhood, I always thought it was negative based on seeing someone on tv saying it with some authority to mean;
That someone who needs something (money, attention, involvement in a dispute) will act like your friend to get what they want from you.
It was said in a “oh yeah, a friend in NEED is a friend INDEED” in quite a sarcastic way. That was my first encounter with the phrase.
I’m struggling to see it the other way without extra words!
I.e “Someone who is a friend when you are in need, will show their friendship by their deeds.”
With the phrase as it is, it makes it sound like the friend in need and the friend indeed or in deed are the same person.
My head hurts now.