After removing old application but not its devices, OTAA join fails when using old device again

687/5000

I created a new application, registered a device. Used the device’s appEui, appKey copy function to register with OTAA. In the example sketch of the Things network, I pasted the keys, set the fequency to EU and uploaded things uno node.
I see messages in the gateway traffic with my deviceId, but it is not registered.
This used to work, but not anymore.
I have removed the old application and have not deleted the devices there, so my device registration is error state, which I cannot resolve.

Can someone repair the device registration so that I can use these devices again

All help is appreciated