What kind of diet are you doing? I did a low carb not keto diet for a while and while it worked a treat, it lead to low mineral levels, particularly magnesium.
But it does sound like you have a lactate buildup issue. True, stretching is proven not to help for torn muscle fibres from muscle building, but it definitely helps for lactate buildup. Also try other things like the last 5-10min of a ride just roll the legs over really easily as a cool down. Give them a little massage to flush after a ride. Just moving the muscle helps.
Also with your WPI if you’re mainly riding, just take it immediately after exercise. You shouldn’t really need it outside of that. If you do and it appears to be helping, then you probably need to look at what you’re getting in from your diet.