I actually spent a lot of time working on one. As usual there isn't a whole lot of special sauce that makes it impossible but its an immense amount to replicate all of the features as well as a rather expensive to run piece of software if you want something like segments and high score boards.
And after all this, your user base consists of the people who didn't want to pay for strava.
I built one for myself, sqlite + apache superset. I basically did that because over the years I had switched devices from different companies and I used to use endomondo which was shut down. I wanted to have all my data in once place. It does require me to export data from device and use my import script once a while, however works for me.
Progress is slow as a solo dev who contributes to it in their spare time, but I’m happy enough with it that I could archive my Strava account and switch to it fully.
And after all this, your user base consists of the people who didn't want to pay for strava.