How long exactly do they stay on? Because there's an important difference between a few minutes (which is normal) and half an hour or more.
The behavior you're describing is super common in modern Corollas. A lot of manufacturers keep the taillights on for a while after you shut off the car for safety reasons, especially if you're getting home late at night. It's a time relay that works on purpose - it's not a malfunction. My car does exactly the same thing and I spent weeks thinking something was wrong until I realized they turn off on their own after like 3-4 minutes.
What you should actually check is whether you have some "coming home" or "leaving home" feature enabled on your dashboard. Some models have these options in the settings menu and they can keep the taillights on longer than usual. If you're not sure whether it's on, checking your owner's manual will save you an unnecessary trip to the shop. That said, if they stay on for way longer (like more than 10 minutes), there could actually be something weird going on with the relay or the control module, but first we'd need to confirm exactly how long we're talking about.