It would help if you talked to me like I'm dumb.
I might lose a male friend because they could be getting romantically attached to me after I talked to them just like they're a girl.
I grew up around mostly girls and women to the point I don't fully get why I can't tell guy friends I love them. I kept telling one "I love ya dude!" To me, that sounds the same as "I love you as a friend!"
I thought spelling "you" as "ya" and adding the word "dude" firmly said "you're in the friend-zone." But no.
This is easily not the only example of where I fucked up, but I won't know unless it's pointed out to me and explained.
I'm furious that I live in a society :amerikkka: where I can't just tell guy friends that I love them.
I don't think your language choice was really the problem. Like I'm pretty sure you could have explicitly said "you're a great friend, I love you as a friend, I'm glad we're friends" and the guy likely still would have gotten attached. Just speaking from experience as a guy, it's not like attraction is rational. If you get emotionally intimate with someone who could conceivably develop romantic or sexual interest in you, there's going to be a risk it happens no matter what boundaries you set or how you speak to them. And the only real way to reduce the risk is to reduce the level of intimacy in the relationship.
In other words, its not necessarily that you told him you love him, it's that you loved him to begin with. Imo anyway.