Injecting flow loaded in memory into running node-red not working

Hi, I have an application where the flow is delivered encrypted.
The idea is that when the system boots a javascript script will decrypt the flow, load it straight into memory then inject into the node-red environment.
According to mostly ChatGPT's help I am using a scrypt for this purpose that sucessfully decripts the flow but fails to inject. When run it I get a message:
Error injecting flows: 401 Unauthorized

I checked credentials at the decrypt scrypt and included them in the settings.js as below:

httpNodeAuth: {
    user: "myusername",
    pass: "$2y$08$xt16.Rj52LtNuN9./Nmr5GUgnZe54fvH6......."
},

// Protect static files served at `/`
httpStaticAuth: {
    user: "myusername",
    pass: "$2y$08$xt16.Rj52LtNuN9./Nmr5GUgnZe54fvH6......."
},

adminAuth: {
    "type": "credentials",
    "users": [
        {
            "username": "myusername",
            "password": "$2y$08$xt16.Rj52LtNuN9./Nmr5GUgnZe54fvH6.......",
            "permissions": "*"
        }
    ]
},

Editor and dashboard work ok with authentication with these settings.

What does ChatGPT and myself are missing here?
Assistance welcome.

Note: credentials edited for publishing online

Just tested:
curl -X GET http://localhost:1880/flows -u myusername:$2y$08$xt16.Rj52LtNuN9./Nmr5GUgnZe54fvH6.......
Unauthorized

is that the encrypted password?