Your code badly mixes callbacks with async/await promises.
The beforeRender already finishes, but your callbacks to connection.execute haven't been invoked yet.
Try to take your code outside the jsreport into a plain nodejs file and debug it to get a better understanding. This isn't about jsreport but proper javascript coding. You need to set to req.data before the function beforeRender actually exits.