I guess the problem is here, plotting the solar position from `modelchain.position.get_solarposition()`
However somehow the AC power looks somewhat okay?

The only difference I see is this, this is the datetimeindex for the broken modelchain:
DatetimeIndex(['2023-01-11 00:00:00+00:00', '2023-01-11 01:00:00+00:00',
'2023-01-11 02:00:00+00:00', '2023-01-11 03:00:00+00:00',
'2023-01-11 04:00:00+00:00', '2023-01-11 05:00:00+00:00',
'2023-01-11 06:00:00+00:00', '2023-01-11 07:00:00+00:00',
'2023-01-11 08:00:00+00:00', '2023-01-11 09:00:00+00:00',
'2023-01-11 10:00:00+00:00', '2023-01-11 11:00:00+00:00',
'2023-01-11 12:00:00+00:00', '2023-01-11 13:00:00+00:00',
'2023-01-11 14:00:00+00:00', '2023-01-11 15:00:00+00:00',
'2023-01-11 16:00:00+00:00', '2023-01-11 17:00:00+00:00',
'2023-01-11 18:00:00+00:00', '2023-01-11 19:00:00+00:00',
'2023-01-11 20:00:00+00:00', '2023-01-11 21:00:00+00:00',
'2023-01-11 22:00:00+00:00', '2023-01-11 23:00:00+00:00',
'2023-01-12 00:00:00+00:00'],
dtype='datetime64[us, UTC]', name='datetime', freq=None)
And this is the datetimeindex for the separate script which is working:
DatetimeIndex(['2023-01-11 00:00:00+00:00', '2023-01-11 01:00:00+00:00',
'2023-01-11 02:00:00+00:00', '2023-01-11 03:00:00+00:00',
'2023-01-11 04:00:00+00:00', '2023-01-11 05:00:00+00:00',
'2023-01-11 06:00:00+00:00', '2023-01-11 07:00:00+00:00',
'2023-01-11 08:00:00+00:00', '2023-01-11 09:00:00+00:00',
'2023-01-11 10:00:00+00:00', '2023-01-11 11:00:00+00:00',
'2023-01-11 12:00:00+00:00', '2023-01-11 13:00:00+00:00',
'2023-01-11 14:00:00+00:00', '2023-01-11 15:00:00+00:00',
'2023-01-11 16:00:00+00:00', '2023-01-11 17:00:00+00:00',
'2023-01-11 18:00:00+00:00', '2023-01-11 19:00:00+00:00',
'2023-01-11 20:00:00+00:00', '2023-01-11 21:00:00+00:00',
'2023-01-11 22:00:00+00:00', '2023-01-11 23:00:00+00:00',
'2023-01-12 00:00:00+00:00'],
dtype='datetime64[ns, UTC]', freq='H')
As you can see the broken one has no frequency defined. Could that be it? I can hardly believe that would break the whole modelchain...