Modal Forms & Media DB Combination

First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.

What I’m trying to do

I am trying to have modal forms in my template run immediately after I call the Media DB template. This way I can easily and quickly put in information like was this recommended to me, what is the priority, is this one of my fav movies, what do I rate it, etc.

Things I have tried

I had created a modal form for the fields I want and set up my template like this

<% "---" %>
<%*
  const modalForm = app.plugins.plugins.modalforms.api;
  const result = await modalForm.openForm("NewMovie");
  tR += result.asFrontmatterString();
-%>
<% "---" %>
{{plot}}

{{ url }}

However, when I run it using a Quick Add Macro as Media DB uses the template I designated I get the follow

---
type: movie
year: 2023
dataSource: OMDbAPI
url: https://www.imdb.com/title/tt14849194/
id: tt14849194
director:
  - Alexander Payne
duration: 133 min
onlineRating: 7.9
actors:
  - Paul Giamatti
  - Da'Vine Joy Randolph
  - Dominic Sessa
image: https://m.media-amazon.com/images/M/MV5BOWY3MjUzZTctOTI5ZC00MDA5LTk4ZTMtZWJjNjRmMzE4ZmI2XkEyXkFqcGc@._V1_SX300.jpg
---
---
obsidianUIMode: preview
genres:
  - Comedy
  - Drama
  - Seasonal
status: To Watch
favourite: false
priority: 🟠 Medium
recommended: false
---
A curmudgeonly instructor at a New England school remains on campus during Christmas break. He soon forms an unlikely bond with a brainy but damaged troublemaker, and with the school's cook, a woman who just lost a son in the Viet...

https://www.imdb.com/title/tt14849194/

As you can see the modal form data did not end up in the frontmatter of the file. Does anyone know how to solve this?