Supplied bookmark [FB:kcwQcw6pr0IHR5SzcD5sXAYZawGQ] does not conform to pattern neo4j🔖v1:tx

I am using neo4j 4.2 . I have written a python script which contains lots of queries.
After connecting neo4j bolt client I am getting
Supplied bookmark [FB:kcwQcw6pr0IHR5SzcD5sXAYZawGQ] does not conform to pattern neo4j:bookmark:v1:tx

I tried uninstall neo4j Neobolt and reinstalled neo4j using pip install neo4j again . It was one of the solution in a post regarding to this error. But in my case it is not working . please help me.
My script was running in 3.5 neo4j version using session. run(). but now I have seen session.write.transaction(). and tx.run(). there are lots of changes in. neo4j. 4.2. is it the one. one. the reason of my. problem cause I used session.run and no tx.run() .can y kindly enlighten me that why tx.run() and session.write.transaction() Is working instead of session.run()

Firstly, this looks like you're using a driver v4.2 with a server v3.5 (... does not conform to pattern neo4j:bookmark:v1:tx would not be sent by a 4.2 server, for instance). This is not officially supported. Each driver officially supports 2 version of the server. A driver of v4.2 will work with a server v4.1 and v4.2. Every other server version might, might partially, or might not work at all; there is no guarantee made.

Secondly, I'd like to see a minimal code example that causes this issue. I suspect there might be a bug in there on top of the aforementioned.

@rouven.bauer sorry for late reply here is my working code at 3.5.14 version neo4j. It was working fine. but after upgrading 4.2 version and the driver I am getting the error , here is the node creation code for sample .if you need some more to observe I will provide you later

from timeit import default_timer as timer
import re

from neo4j import GraphDatabase,basic_auth
from os import listdir
from os.path import isfile, join
neo4jUri="bolt://localhost:7687"






graphdriver=GraphDatabase.driver(neo4jUri,auth=basic_auth("neo4j","XXXX"))
nodesourcefolder="/var/lib/neo4j/import/"
def NodeCreate():
    
    begin=timer()
    with graphdriver.session() as session:
        
        for i in nodefiles:
            if (i=="nodes_AGENT_C_20190727.csv"):
                
                agentquery=CreateNodes(i,"AGENT")
                session.run(agentquery)
                print("AGENT node is Created")
            elif(i=="nodes_CUSTOMER_C_20190727.csv"):
                customerquery=CreateNodes(i,"CUSTOMER")
                session.run(customerquery)
                print("CUSTOMER node is created")
            elif(i=="nodes_MERCHANT_C_20190727.csv"):
                merchantquery=CreateNodes(i,"MERCHANT")
                session.run(merchantquery)
                print("MERCHANT NODE is created")
            elif(i=="nodes_ATM_C_20190727.csv"):
                atmquery=CreateNodes(i,"ATM")
                session.run(atmquery)
                print("ATM Node is Created")
            elif(i=="nodes_BANK_C_20190727.csv"):
                bankquery=CreateNodes(i,"BANK")
                session.run(bankquery)
                print("BANK NODE IS CREATED")
            elif(i=="nodes_BILLER_C_20190727.csv"):
                billerquery=CreateNodes(i,"BILLER")
                session.run(billerquery)
                print("BILLER Node is created")
            elif(i=="nodes_CARD_C_20190727.csv"):
                cardquery=CreateNodes(i,"CARD")
                session.run(cardquery)
                print("CARD NODE Is Created")
            elif(i=="nodes_DM_C_20190727.csv"):
                
                disbursmentquery=CreateNodes(i,"DM")
                session.run(disbursmentquery)
                print("Disbursment Node is Created")
            elif(i=="nodes_NON_C_20190727.csv"):
                nonlabelquery=CreateNodes(i,"NONLABEL")
                session.run(nonlabelquery)
                print("Non label node is created")
            elif(i=="nodes_REMITTER_C_20190727.csv"):
                remitterquery=CreateNodes(i,"REMITTER")
                session.run(remitterquery)
                print("REMITTER NODE IS CREATED") 
    session.close()            
    end=timer()
def CreateRelationship(filename,fromlabel,fromnode,tolabel,toNode,relationship):
    
    
    relationquery="""USING PERIODIC COMMIT 100000
                      LOAD CSV WITH HEADERS FROM 'file:///%s' AS row
                      MATCH (a:%s {WALLETID: row.%s})
                      MATCH (c:%s {WALLETID: row.%s})
                      MERGE (a)-[r:%s]->(c)
                      return count(*)"""%(filename,fromlabel,fromnode,tolabel,toNode,relationship)
    return relationquery

NodeCreate()

when I am calling the NodeCreate() function I am getting the error.