Because casting the portal skill failed. Basically, you want to keep TP scrolls regardless because if you need to use a portal, but due to your CR not killing everything around you at a time (or due to other things like a ground effect or DoT), the cast can fail, so it falls back to trying to use a TP scroll, which is instant. If not for that behavior, the bot would get stuck trying to cast the portal, which would most likely never work since you're taking damage and the cast gets interrupted. That happened in the past quite often, so that's why the fallback to TP scroll was added, and then it logs inside that logic if that fails.