It should terminate automatically. Try a reboot. If that does not work, and it still runs perpetually, report it to the Paste developer, as it may be a bug in their app or with an interaction of their app with Shortcuts.
That said - it’s not the first Shortcuts bug I have seen or read about. I get the definite sense that Shortcusts isn’t quite ready for prime time on MacOS.