correct there are many ways to fast. Big Ramy and Hadi both fast once a year for a month. so do almost all middle east bodybuilderse who are now dominating the sport.
the study i posted was from athletes who did alternate day fasting for 70 days. they weren't just fat people who stopped eating. the end results was a loss of a significant amount of fat and muscle did not change. it wouldn't matter if you were fat, skinny, athletic, etc. the human body has mechanisms in place to help preserve muscle and lose fat during a fast
isn't that what we want in this game? lose fat and keep muscle. the other thing i posted showed how our bodies react when fasting. notice protein flat lines but glycogen and fat move rapidly inverted.
even if you prolong fasted hypothetically and stopped weight training during it you would lose globs of fat and any muscle you may lose will be gotten back once you break the fast and start up your training again. so fasting is a weapon
https://blog.2keto.com/protein-loss/ this link shows how fat/ketones and carbs go inverted during a fast and how protein flat lines. the study was done here
https://pubmed.ncbi.nlm.nih.gov/4915800/ and the bottom line is if humans did not have this happen during 'starvation' our species would have gone exctinct a long time ago. this blows away the idea that you need to eat every 2 hours or any of that other bro science we grew up reading in magazines and it drives supplement companies nuts. they want you to think this so you buy their bcaas, protein powders, weight gainers, etc.
so to answer the OP's question will you GAIN muscle on a fast? no. but you also won't lose it either all things being equal while losing tons of fat. my advice to anyone who is curious is try it yourself. do a simple Monday- friday water fast. just water. i promise you won't lose your muscle like magic lol