How to resolve "Node [ ...] not in use"?

I'm getting an error I've never seen before that I don't really know how to approach.

Node[5250885,used=false,rel=-1,prop=-1,labels=Inline(0x0:[]),light,secondaryUnitId=-1] not in use

I have a complicated, custom stored procedure that deletes several nodes and relation before recreating a new set of simulated data. I've developed it on a copy of my database where it works as intended. Today I'm trying to apply it to the working copy.

I found this problem and solution from 2016 on github: https://github.com/neo4j/neo4j/issues/7711 with a solution to use a tool by @michael.hunger to make a copy of the original database without broken nodes/relations: https://github.com/jexp/store-utils/tree/30

When I try to install and use it, Maven gives me 'Unauthorized' errors for downloading Neo4j 3.5.2 enterprise (the version I'm working with inside Neo4j Desktop).

Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.neo4j:neo4j-enterprise:pom:3.5.2 from/to neo4j-enterprise (http://m2.neo4j.com/enterprise): Authentication failed for http://m2.neo4j.com/enterprise/com/neo4j/neo4j-enterprise/3.5.2/neo4j-enterprise-3.5.2.pom 401 Unauthorized

When I hit that download URL directly in the browser, I get a popup to logon. I'm not an enterprise user, so when I found this reference in the Neo4j reference manual I find myself in a Catch 22.

Is there a way to "upgrade" from enterprise 3.5.2 to community 3.5.11?

Is there another way to fix the broken nodes in my database?

I solved the general problem by commenting out the DELETE query from my procedure and just ran it from the browser before running my procedure.

(The dog took me for a walk and I came back with a clear head. Good dog.)

I'm still curious about the error message: why it happens in the procedure but not the browser.

I'm also curious about when using the enterprise version from Neo4j Desktop will come back to bite me again...and what I can do about it besides recreating the db from scratch.

This issue is still there in community v4.0.6. When trying to delete a set of Nodes it gives this error:
ERROR Client triggered an unexpected error [Neo.DatabaseError.General.UnknownError] Node[...] not in use. The total number of nodes that I'm trying to delete are 190 so it's not because of huge dataset.
This is the error log from debug.log file:

ERROR [o.n.b.r.s.i.ErrorReporter] Client triggered an unexpected error [Neo.DatabaseError.General.UnknownError]: Node[253013,used=false,created=false,rel=-1,prop=-1,labels=Inline(0x0:[]),light] not in use, reference 0fe8a209-a18b-4f78-8b5d-7ba61d67b3b8. Node[253013,used=false,created=false,rel=-1,prop=-1,labels=Inline(0x0:[]),light] not in use
org.neo4j.kernel.impl.store.InvalidRecordException: Node[253013,used=false,created=false,rel=-1,prop=-1,labels=Inline(0x0:[]),light] not in use
	at org.neo4j.kernel.impl.store.record.RecordLoad.verify(RecordLoad.java:63)
	at org.neo4j.kernel.impl.store.CommonAbstractStore.verifyAfterReading(CommonAbstractStore.java:1086)
	at org.neo4j.kernel.impl.store.CommonAbstractStore.readRecordFromPage(CommonAbstractStore.java:926)
	at org.neo4j.kernel.impl.store.CommonAbstractStore.readIntoRecord(CommonAbstractStore.java:877)
	at org.neo4j.kernel.impl.store.CommonAbstractStore.getRecord(CommonAbstractStore.java:844)
	at org.neo4j.internal.recordstorage.Loaders$1.load(Loaders.java:141)
	at org.neo4j.internal.recordstorage.Loaders$1.load(Loaders.java:131)
	at org.neo4j.internal.recordstorage.RecordChanges.getOrLoad(RecordChanges.java:69)
	at org.neo4j.internal.recordstorage.RelationshipDeleter.updateNodesForDeletedRelationship(RelationshipDeleter.java:104)
	at org.neo4j.internal.recordstorage.RelationshipDeleter.relDelete(RelationshipDeleter.java:58)
	at org.neo4j.internal.recordstorage.TransactionRecordState.relDelete(TransactionRecordState.java:285)
	at org.neo4j.internal.recordstorage.TransactionToRecordStateVisitor.visitDeletedRelationship(TransactionToRecordStateVisitor.java:98)
	at org.neo4j.storageengine.api.txstate.TxStateVisitor$Delegator.visitDeletedRelationship(TxStateVisitor.java:187)
	at org.neo4j.storageengine.api.txstate.TransactionCountingStateVisitor.visitDeletedRelationship(TransactionCountingStateVisitor.java:115)
	at org.eclipse.collections.api.block.procedure.primitive.LongProcedure.accept(LongProcedure.java:30)
	at org.neo4j.kernel.impl.util.collection.AbstractLinearProbeLongHashSet.each(AbstractLinearProbeLongHashSet.java:124)
	at org.neo4j.kernel.impl.util.collection.AbstractLinearProbeLongHashSet.forEach(AbstractLinearProbeLongHashSet.java:103)
	at org.neo4j.kernel.impl.api.state.TxState.accept(TxState.java:131)
	at org.neo4j.internal.recordstorage.RecordStorageEngine.createCommands(RecordStorageEngine.java:271)
	at org.neo4j.kernel.impl.api.KernelTransactionImplementation.commitTransaction(KernelTransactionImplementation.java:695)
	at org.neo4j.kernel.impl.api.KernelTransactionImplementation.closeTransaction(KernelTransactionImplementation.java:602)
	at org.neo4j.kernel.impl.api.KernelTransactionImplementation.commit(KernelTransactionImplementation.java:569)
	at org.neo4j.bolt.dbapi.impl.BoltKernelTransaction.commit(BoltKernelTransaction.java:52)
	at org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine$State.closeTransaction(TransactionStateMachine.java:410)
	at org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine$State$2.commitTransaction(TransactionStateMachine.java:362)
	at org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine.commitTransaction(TransactionStateMachine.java:101)
	at org.neo4j.bolt.v4.runtime.InTransactionState.processCommitMessage(InTransactionState.java:94)
	at org.neo4j.bolt.v4.runtime.InTransactionState.processUnsafe(InTransactionState.java:52)
	at org.neo4j.bolt.v3.runtime.FailSafeBoltStateMachineState.process(FailSafeBoltStateMachineState.java:48)
	at org.neo4j.bolt.runtime.statemachine.impl.AbstractBoltStateMachine.nextState(AbstractBoltStateMachine.java:143)
	at org.neo4j.bolt.runtime.statemachine.impl.AbstractBoltStateMachine.process(AbstractBoltStateMachine.java:91)
	at org.neo4j.bolt.messaging.BoltRequestMessageReader.lambda$doRead$1(BoltRequestMessageReader.java:90)
	at org.neo4j.bolt.runtime.DefaultBoltConnection.lambda$enqueue$0(DefaultBoltConnection.java:151)
	at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatchInternal(DefaultBoltConnection.java:240)
	at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:175)
	at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:165)
	at org.neo4j.bolt.runtime.scheduling.ExecutorBoltScheduler.executeBatch(ExecutorBoltScheduler.java:212)
	at org.neo4j.bolt.runtime.scheduling.ExecutorBoltScheduler.lambda$scheduleBatchOrHandleError$2(ExecutorBoltScheduler.java:195)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:834)```