see more details on this issue at InDesign UserVoice and vote for fixing the problem:
Running head containing forced line break inserts space incorrectly
Anonymous, September 05, 2019
FWIW: Don't think that the behavior with text variables was different in previous versions of InDesign.
( ACP )
Thanks – Voted to fix it 🙂
That's standard behavior for Text Variables. What specifically are you trying to accomplish? They may be a way to work around that limitation, depending on what you're trying to do.
Is it by design? It feels like a bug 🙂
Can you give me an exaple where this would be helpfull?
Thanks – I will have a look
the workaround would be to have no line breaks.
If you need a line break do it without a line break special character.
Two examples below:
 A very wide white space applied by a character style.
 Use text wrap.
( ACP )
Thanks for the work around – Looks like I will have to use a MacGyver solution for now.