It can work, I've done it, at times in my life when I was absolutely definite I didnt want to be in a committed relationship, because I was busy focusing on my own life and career.
After a certain amount of time it's inevitable that some element of emotions creeps in, on one side or the other. Thats when you end it and walk away.
I never attempted it with an existing friend, as that would make it too emotionally complicated, but had several FWB-type relationships with people I met.
If you're both completely clear and honest with each other about what you want and what your boundaries are, both at the beginning and on the way through, it can work well. You both need to like and respect one another too, to enable the honesty.
Actually that's a bit harder to find in a sexual partner than you might think, but if you can then it can be great fun and actually really liberating.
Probably worth pointing out it only worked for me in my thirties, when I was grown up enough and emotionally experienced enough to be able to deal with it.