In fact building a 5th gen J-20 is even more difficult than building an airliner. Russia and France(airbus) both with extensive years of building airliner struggle to come up with a workable 5th gen fighter. Russia Su-57 is given up eventually after the technical hurdle to clear is too much to bear. While France, dont even have the know how for how to make a 5th gen , dont even attempt one cos the difficulties are too much. While China succeed with 5th gen.
China is late to airliner, not becos of lacking the know how but more becos of the politics and policy in the past that prevents it.
https://en.wikipedia.org/wiki/Shanghai_Y-10
As for what happened to Y-10 were purely due to political and economic development priorities during that time.
China started airliner development at the same time with airbus. What is even more commendable , it is design and develop when China industries technical were very primitive. Fast forward to 2017, with powerful supercomputer, world class wind tunnel. China is even in a more favourable position to easily make a world beater airliner. Remember C919 is the first truly state supported airliner project. ARJ-21 is initial by the private sector of China and is not considered , the first truly China endorsed airliner project.
I am very sure C919 is a very competitive design which rivals Boeing and Airbus. Even without Russia, China can easily handle CR929 development and design. Its more of a strategic gesture, China accept Russia into the CR 929 project and sub out a few parts for Russian to be involved merely as a symbol of Sino-Russian collaboration.