Israel did it. India did it. Even Pakistan did it. Why can’t Turkey do it with its better industrial base and expertise?
India's first indigenous fighter jet (Tejas) took 30 years to develop. It is 4th generation and is not nearly as capable as the F-35.
The JF-17 Thunder was jointly developed by the Pakistan Aeronautical Complex and the Chengdu Aircraft Corporation of China. It is a 4th generation aircraft.
Turkey could try, but there is no way they could develop a 5th generation aircraft.