Your code works fine in my Word for Windows desktop application. I do not know that the DisplayBarcode nor MergeBarcode fields work on the Mac, though. As far as I can tell, they only work in Word for Windows desktop.

You could create the QR code in Word for Windows, take a screenshot of the code, and paste that as an image in your Mac version.
You may want to vote and comment on this feedback: https://feedbackportal.microsoft.com/feedback/idea/54b87735-3a0d-f011-a4de-6045bdb3947a Discrepancies between Mac and Windows Word.
These two fields are sort of step-children in the Windows version as well. They do not show up in the Field dialog in Windows even though they were introduced in, I think, 2013. You have to know about them to use them.
==============
I developed an Add-In to insert this field, but since the field does not work on the Mac, neither does the Add-In.