Modelleing a two way transformer with an investment object in oemof

Hello everyone,
first of all I wanted to build an energy system like this:

Lignite source >> Lignite bus            >> Lignite powerplant >> Electricity bus   >> El_Demand
solar source   >> solar bus              >> PV powerplant      >> power bus         >> El_Demand
Gas source     >> [Gas bus, methane bus] >> Gas powerplant     >> Electricity bus   >> El_Demand
                                            Gas powerplant     >> Heat bus          >> Th_demand
                  Electricity bus        >> Methane powerplant >> methane bus 

But it seems that there is no way for oemof to solve this problem. Or to decide which input is the cheaper one.

My idea was to split the gas power plant. In one with a gas input and one with a methane input. But both must have the same investment. So I wanted to add a constraint.
I ended up here in this thread with a similar problem.

But it seems that the solution doesn’t work anymore with the latest oemof version.
I tried
om.InvestmentFlow.investment_costs.expr()
from
https://oemof-solph.readthedocs.io/en/latest/reference/oemof.solph.html?highlight=investmentflow#oemof.solph.blocks.investment_flow.InvestmentFlow

But I don’t understand the command correctly.
I have tried this in different versions:
om.InvestmentFlow.investment_costs.expr(invest[i, o])
The output is always the total investment of all transformers, no matter what the input is.

Do you have a solution?
Greetings
Philipp