As a long-time ref and former sufferer of exactly this pain, I'd suggest you consider one self-treatment option - triggerpoint massage... It has worked a treat for me over the years on this and many, many other muscle aches and pains. Who knows, you may eventually need a leg replacement, but the beauty of first assessing so-called triggerpoints is that they are self-treatable, often highly-correctable, there is very little risk if you massage them even vaguely correctly, and the treatment is free.
Triggerpoints are thought to be areas of adhesion between fascia, adhesions between fascia and nerves, knots in muscle fibers, etc. I don't think anyone is yet really sure. But that doesn't matter. If they are present, massage works.
There is a well-known triggerpoint where the lower middle of the two heads of the gastrocnemius muscle (the big bulgy thing below the back of the knee) meet the top of the soleus muscle (the long smooth thing that goes up from the heel and the tendon, then underneath the gastroc). That triggerpoint refers pain into the achilles, believe it or not.
If you carefully probe around in there with your thumb, I bet you will feel a very specific, extremely uncomfortable, almost electric pain. 15-30 secs. of slow circular massage in that 1/2-1" area 3-4X a day at a pain level of no more than 5-6 on a 10-point scale - (physios call it "therapeutically delicious". Basically, "it hurts so good!") - should result in noticeable improvement in as little as a day. If you don't see improvement in a couple of days, then try the next step (I agree with JamesL; that next step should be a physio, NOT an orthopedic surgeon - the latter only leads to one of two things; cortisone injections or an unnecessary surgery).
There is an incredible book available called "The Triggerpoint Therapy Workbook", by Claire and Amber Davies. It deals with this issue and hundreds of others. I am on my third copy - I've worn the others out.
Additionally, there is a wide variety of websites that discuss this treatment method as well.
Once the pain is reduced, then stretching is critical, but not until the pain is reduced.
I really would be interested in whether you experience any benefit if you decide to at least try the self-treatment route.
Good luck!
(Workbook URL:
https://www.amazon.com/Trigger-Point-Therapy-Workbook-Self-Treatment/dp/1608824942/ref=sr_1_1?crid=1WTBWA3TBJAO5&dib=eyJ2IjoiMSJ9.ATEDByL78XMPmYr-zPP3JqOkdoYIyn-XTPoYp7BHfCrSullFA7g6BVjrT40TaNM0EaP4s69cLfoAgDIbvNvapo5TdNemBM_w2qTLkmMsHKU.q1c4b1DLl8Ub4nm_toGPMALt9GstiFV6lNJicvvVseM&dib_tag=se&keywords=triggerpoint+therapy+workbook&qid=1730306347&s=books&sprefix=triggerpoint+therapy+workbook,stripbooks,142&sr=1-1)