If there is perfect competition, then yes, you will get zero economic profit, but even then, technology does no poof out of nowhere. Otherwise, you might find very different results.
Let's think of the nature of competition through product differentiation. (We'll get into technology later.) Imagine two firms making their own widgets in Cournot competition, but instead of the normal price function $P = X - q_1 - q_2$, we have
$$P = X - q_i - d\cdot q_{-i}$$ where $-i$ denotes the other firm that is not firm $i$, and $d \in (0,1)$, $1$ being no product differentiation, and $0$ being completely different products sold by the two companies.
If $d = 0$, then the firms aren't really competing since their products are completely different and are acting as monopolists, making economic profit. If $d = 1$, then the firms are competing through regular Cournot and still making profit (probably).
In Bertrand, we can consider product differentiation as part of determining how much of the market you will steal away by undercutting price. The way a normal Bertrand model works is that you set price and then produce (as opposed to Cournot, where you set production, which affects the price). If you have a lower price, and there is no product differentiation, you steal away the whole market, so each firm will push price down to the price under perfect competition, where both firms split the market.
With product differentiation though, you don't lose the whole market when you are undercut, since your product is still a bit different. With full differentiation $(d=0)$ then you get the same result where each firm act as monopolists.
Under each of these models, technology doesn't "just happen", but is reflected through lowering the marginal costs of the firm, which is essential for the firm to be competitive against its rivals. The less technologically advanced the firm is, the more of the market they will lose out on. Economic profit here can be used to invest into research and development or just straight up "technology" to reduce the cost of capital usage over time or other such things like that.
Even in perfect competition with no economic profit, the reason there is no economic profit will partly be because firms have to constantly update their technology to remain competitive, regardless of how differentiated the products are (as long as $d > 0$).