The description suggests the fan's Live and Neutral have been taken from the cable to the switch and the fan's Switched Live taken from Permanent Live.
All the OP has done is to connect the existing cable to a replacement fan, the previous fan having worked correctly when wired to the same cable. I therefore don't think there's anything wrong with the origins of that cable.
As I said, I think at simple neutral/permanent live reversal at the connections to the fan would result in the behaviour the OP is describing:
With light on or off:
N is connected to fan's P/L terminal
P/L (permanent 230V) is connected to fan's N terminal
there is therefore always the required 230V between fan's N and P/L terminals
With light on:
230V S/L is connected to fan's trigger ('S/L' terminal). The trigger terminal is therefore at the same potential as the fan's 'neutral' - so the fan sees no (N-S/L) trigger voltage, hence fan is not on.
With light off:
fan's trigger ('S/L') terminal is at N potential (via lamp), so the fan sees 230V between its trigger ('S/L') and 'neutral' (which is at 230V) terminals - hence fan is triggered to operate.
When light is turned back on, the trigger voltage disappears from it's S/L terminal (as above), so it over-runs for the timed period, then stops
... which I believe is the behaviour the OP has described.
Kind Regards, John