Export created timer with FormatExpression

The following code creates a timer with duration. However after the timer is created export does not work - the following exception is thrown

index.esm.js:709 Uncaught (in promise) TypeError: value.search is not a function
    at BodySerializer.build (index.esm.js:709)
    at eval (index.esm.js:874)
    at forEach (index.esm.js:344)
    at TypeSerializer.ElementSerializer.parseContainments (index.esm.js:868)
    at TypeSerializer.ElementSerializer.build (index.esm.js:748)
    at eval (index.esm.js:894)
....
  const elementRegistry = bpmnJS.get("elementRegistry");
  const bpmnFactory = bpmnJS.get("bpmnFactory");
  const modeling = bpmnJS.get("modeling");

  const task = elementRegistry.get("Activity_18o1v1u");
  const event = modeling.createShape(
    {
      type: "bpmn:BoundaryEvent",
      eventDefinitionType: "bpmn:TimerEventDefinition"
    },
    { x: task.x, y: task.y },
    task,
    { attach: true }
  );
  let businessObject = event.businessObject;
  const eventDefinition = businessObject.eventDefinitions[0];
  const timeDuration = ElementHelper.createElement(
    "bpmn:FormalExpression",
    { body: 1000 },
    eventDefinition,
    bpmnFactory
  );
  eventDefinition.set("timeDuration", timeDuration);

Here is example: bpmn-js Sandbox (forked) - CodeSandbox

The problem here is that you pass a number value to a string property. If you enclose the body value in quotation marks, it works correctly. It seems that we assume you pass value of correct type which is not the case in your codesandbox.