I figured it out.
In case someone else gets stuck at this point. When calling synchronously, the parameters of the function must be complete:
const var th = Engine.createTransportHandler();
th.setSyncMode(1);
th.setEnableGrid(true, 5);
inline function onGrid(grid, timestamp, first) // Parameters need to be complete
{
Console.print(grid);
}
th.setOnGridChange(true, onGrid);