When the warning light comes on, the transmission goes into 'safe' (limp home) mode, which is why it changed down to 3rd gear. This is the
taking control and trying to limit potential damage.
The fact that when you switched off, then restarted and all was fine indicates an intermittant fault. These are the worst possible to track down and nothing can be done really unless the fault is actually there at the time.
I'm not entirely sure about this (and hopefully someone will confirm) but it could be that a fault code has been logged in the transmission
even though the fault is intermittant. It may be worthwhile having the
scanned for possible fault codes by an independant garage or automatic transmission specialist. At least then you will know if the future problems are likely to be major or minor.