In some sense yes, if they couldn't live only from the return on their investments, they are technically a worker. That would be the Marxist definition but it's obviously more of a spectrum than a binary. CEOs in most large companies of course have enough wealth that they could live on that alone and they are only working as CEOs in order to increase that wealth. Their work also plays an anti-labour role in collaborating with the shareholder class against the interests of the worker.
I suspect there are quite a few software engineers who have been making $250K+ for some years who could live on the return on their investments alone.
I mean, I guess it also depends on live at what standard of living. At the standard of living they are "accustomed to", or at the standard of living of someone making $50K a year? Some larger number of software engineers who have been making $250K could live on their investment income alone for equiv of $50K/year after taxes.
So, right, more of a spectrum than a binary -- you see why some people are dubious of whether a software engineer making $250K a year is really in the same class as a retail worker making $50K a year (or less; federal minimum wage is still $7.25; my state's minimum wage is $13.25, less than $30k/year, a shockingly small amount to many of us, that many people actually make)
On other conversations, people have suggested that whether you are a "boss" and can hire and fire is determinative. But again, a fast food "manager" might be making only $50K a year, while a software engineer who does not manage people might be making $250K or more. The software engineer is a "worker" who definitely has the same class interests as a walmart worker, but the fast food manager is definitely not? Doesn't really check out.
You say "the Marxist definition", but I think that's actually a huge over-simplification of a Marxist analysis. Your class position and interests have to do with your income, your "relationship to the means of production" (role in the economy), your wealth, and other things. And it's probably useful to consider more than 2 or even 3 classes, and sub-classes within classes.
I think it's a huge over-simplification to claim that every software engineer making $250K surely is in the same class and has the same class interests as every fast food worker making $12/hour. That's not in fact a good Marxist analysis at all.
The pandemic made it pretty clear to me that there is definitely a class divide between the people in jobs where they paid to work from home (or in many cases, especially at first, stay home and not work); and the people who had to come in to get paid and/or who were were told not to come/laid off because there was no work to do.