Immediately after death nerves that create movement within the muscle can still be triggered by electrical pulses and it begins twitching.

So the fish is actually dead, it’s muscles just don’t know it yet.