Shortcuts: adding text in middle of markdown journal

I’m trying to automate as much of my journalling process as possible.
I was working on a shortcut that

  1. asks if I want today’s or yesterday’s entry
  2. searches in the Journal database for that date formatted as yyyyMMdd
  3. copies the entire text of the resulting file.
  4. does a search for a specific string at the bottom of each entry (a TOC and some formatting text)
  5. replaces it with new entry text (heading/time of day) and the TOC
  6. copies it back into the file.

The weird thing is I did all the work on my iPad and got it working perfectly there but when I try it in my iPhone I only get a result of a hex string from the get contents of the file command.
If I do a basic search in DTTG for say, 20211109, I get today’s entry only, as I would expect.

I had an issue with search not working properly on my phone which may be a factor. Anyone have any other suggestions?
I’ll link to the workflow in a reply.

This is the shortcut.

For safety this version of the shortcut has a Display Result and Stop Shortcut right before the Search and replace functions so it won’t actually modify any file until I can get the Get Contents to work properly on my phone.

I just did a test by syncing iPad to iPhone via Bonjour. Ran the same shortcut and got two different results.
iPad = contents of todays journal file
iPhone = a string of alphanumeric/hex