Why doesn't stock market help to boost the economic growth directly? For example, during the recession, the central bank often goes to buy financial instruments that are riskier than government bonds (such as corporate bonds)- which is called &quot;quantitative easing&quot; that increases the price and lower the interest yield of these riskier assets.
So, by the action, the central bank indirectly encourages people to invest in the real sector (and not in the stock as returns/interest yields are low) directly which will help boost the economy. This could be an investment in buying a house, land, factory, etc. Even pure consumption could put pressure to produce more commodities.
Therefore, I'm wondering why stocks trading couldn't help to boost economic growth. For example, if the interest yields are high, people will invest in these stocks and earn higher returns thus having extra income that they are willing to spend more on goods and products. Or what is the role of the stock market in economic growth?
First there are some inaccuracies in your question.

The central bank often goes to buy financial instruments that are riskier than government bonds (such as corporate bonds)- which is called &quot;quantitative easing&quot;.

This is simply not true large part of QE program consists of buying government bonds (treasury securities). Private bonds or other long term fixed income securities can be part of QE as well but QE does not focuses on them (see Fed QE explainer).
Now to your question:

what is the role of the stock market in economic growth?

Stock markets or capital markets in general have first order impact on economic growth and development (e.g. see Demirgüç-Kunt, &amp; Levine, 1996; Bekaert &amp; Harvey 1998; Akenten, Boateng, &amp; Kiros, 2020; Freixas  &amp; Rochet (2008) Microeconomics of Banking,  second edition and sources cited therein).
This is because stock markets help to ensure that capital is allocated to its most valued uses by transferring funds that can be used to purchase capital from people who have excess funds  to people who have ability to put that capital to the most efficient uses. Capital accumulation and investment plays an important role in economic growth as you can learn from any textbook on economic growth (e.g. see Sala-i-Martin &amp; Barro (2003) Economic Growth, Second Edition).
However, the above cannot be simply reduced to saying that growth of stock market will translate into economic growth. Rather the relationship is more complex. Stock market helps economy grow by helping to efficiently allocate capital, and when economy grows stock market will generally grow as well because as companies get more productive (or as old companies are replaced by new more productive ones) their valuation increases. Consequently growth of a stock market is rather a consequence of growth of real economy rather than cause of it (even if stock market function itself - not its growth - helps economy grow). In addition to the above it is also important to mention that in order for stock market to fulfill its functions it also needs some appropriate amount of regulation. Poorly designed capital markets might not have the same beneficial effects.
Furthermore, stock market can grow due to number of reasons unrelated to real economy. For example, if there is high amount of savings but low number of viable investment projects then asset prices can increase because of demand caused by people who want to save. If there is high demand for assets such as stocks but at the same time if firms do not have any viable ways of efficiently investing the money, then people might bid the stock prices up without really affecting investment. In addition, you need to distinguish between nominal growth and real growth. In a presence of inflation stock market can grow in nominal terms but not real ones because firms are getting nominally more profitable but not more profitable in real terms.