Dark energy doesn't cause the universe to expand. It just changes the expansion rate (or rate of change of expansion rate, in fact).
There are two things you should consider when data do not match theory. One is that theory is correct but you are missing something about the data. For example, Pluto was found because Neptune was not in quite the predicted place. And the Pioneer Anomaly turned out to be an unexpected thrust effect from the craft itself.
The other is to consider that the theory is wrong. For example, the anomalous precession of Mercury was, in fact, correctly predicted by GR where Newtonian gravity failed.
So GR can explain cosmology and galactic rotation curves, if you hypothesise some additional stuff that we can't see but have named dark matter and dark energy. But investigating alternative theories of gravity is also important - or at least has been. My understanding is that dark matter in particular is winning the argument even if we haven't directly detected it.
There are other reasons to develop alternative theories. One is why not? It can be interesting, and studying generalised models can yield insight even when they're not directly physically relevant. Another is so-called test theories, where you do something like assert that ##F=GMm/(r+\alpha)^2##, then gather data to estimate the value of ##\alpha##, which Newtonian gravity assumes to be zero. Here you aren't really proposing that ##\alpha\neq 0##, but you are just checking anyway.
Finally, we look for theories of gravity to replace GR. It doesn't fit well with quantum theory, and it has singularities that we strongly suspect are only there in the maths. We expect there to be a better theory of gravity - we just haven't found it yet.
I don't honestly know where f(R) theories fit into that. Probably a mix of all of them, but I don't know.