It's behaving same as Safari.
I'm sorry but you are wrong, example below. Please try by yourself. I don't send errors without checking.

If you need interpretation, Safari returns an object when Orion returns an empty string.
The reason behind not returning JS output, is webpage security from external attacks.
This is your choice, but it doesn't behave the same as Safari, and we can still use JSON.stringify first and then JSON.parse. JXA or AppleScript returns an object without any function if this is your point. There is not more security issue, to return an object than a string.
Code for you to try:
const system = Application('System Events');
var process = system.processes.whose({ name: 'Safari' })[0];
var appName = process.displayedName();
var app = Application(appName);
var window = app?.windows?.[0];
var tab = window.currentTab();
console.log('safari', app.doJavaScript('(() => { return {}})()', { in: tab }))
var process = system.processes.whose({ name: 'Orion' })[0];
var appName = process.displayedName();
var app = Application(appName);
var window = app?.windows?.[0];
var tab = window.currentTab();
console.log('Orion', app.doJavaScript('(() => { return {}})()', { in: tab }))