Hey @AhmedAssad-8581 ,
it seems the Node-red logic is running o another machine than the IoT Edge device.
Take a look at the IoT Edge child device support (aka transparent gateway).
There is a node for that. Some background info about the nodered node is seen here.
An example of how to set up a child device can be seen here.