Pen won't work outside of canvas

I had the same issue once. The solution for me was changing the renderer in Krita to something else.

Goto: Settings/Configure Krita…/Display

I found the solution deep down in the vaults of the KA forum: Pen keeps losing contact to canvas

Maybe it helps you either.