Showdown sets Berserk Gene's confusion duration to last 256 turns. This is only accurate if either no Pokémon on that side has been confused, or the last confusion that happened was snapped out of. Specifically, what Berserk Gene does is to not actually apply a confusion duration, it just sets the confusion flag. Said duration is never actually updated when a Pokémon switches out, or is cured of confusion by means other than snapping out of it. Meaning that Berserk Gene will "inherit" the duration of the last applied confusion for that side of the field.
Showdown sets Berserk Gene's confusion duration to last 256 turns. This is only accurate if either no Pokémon on that side has been confused, or the last confusion that happened was snapped out of. Specifically, what Berserk Gene does is to not actually apply a confusion duration, it just sets the confusion flag. Said duration is never actually updated when a Pokémon switches out, or is cured of confusion by means other than snapping out of it. Meaning that Berserk Gene will "inherit" the duration of the last applied confusion for that side of the field.