Functionality for new {{#FORMAL:}} syntax was added in T238433: Inline syntax for language politeness variants (informal/formal), to enable translation into both formal and informal variants in one language code for languages that make that distinction. However, the implementation doesn't support JavaScript yet, while it should.
To reproduce the problem in production:
- Open the browser console
- Type or paste: mw.messages.set( 'mytest', '{{#FORMAL:informal|formal}}' );
- Type or paste: mw.msg( 'mytest' ); and see the result.
- Actual result: {{#FORMAL:informal|formal}}
- Expected result: informal (unless your user interface language is set to de-formal, es-formal or hu-formal, in which case the expected result would be formal).