Marina-om
The problem is that you are not in transit, you are taking two flights that happen to be with the same airline. You have bought two tickets. One ticket to fly to the UK [LGW], and the other ticket to fly to TLS from the UK.
In order to fly to TLS from LGW you have to officially enter the UK.