Changing the selected FX by manipulating the track state chunk ("SHOW n") instead of using TrackFX_SetOpen is broken (SWS does that, it should probably be updated to use the newer function but this still looks like a bug in REAPER on Linux).
The selected item in the chain's list is updated but the new FX is only briefly showed before it goes back to the previous FX's UI. TrackFX_GetChainVisible and GetTrackStateChunk still gives the old FX's index.
https://forum.cockos.com/showthread.php?p=2023280