There's a somewhat subtle and pervasive assumption that all owners will seek only to maximize returns (or similar) but that notion really needs to go.
Even with that assumption, it doesn't matter if you own shares in fossil fuel companies since all investors are equivalent.
Companies are artificial abstractions. The people who invested in the company before you get money. If you consistently engage in a policy of engagement to deal with bad corporate citizens, you increase the positive financial rewards for earlier investors to use their governance influence to direct firms to bad corporate citizenship. Conversely, divestment does the opposite.
The magnitude of the effect of any one investor doing that is small, but that's the situation with all economic boycotts.
I think a slight modification holds, though:
"all owners will seek only to maximize returns across all of their holdings, to themselves"
Chevron causing environmental damage costing me $100 personally outweighs the extra $50 those shortcuts added to my fraction of the company, etc.
And if you include moral/social costs on top of that, then IMO there really isn't anything that the expanded "maximize returns" statement doesn't cover.