Wrong behaviour of dynamic variable on right sidebar

I have a template with the dynamic variable <% current page %> in it
If I create a new page on the journal page and open it in the right sidebar (shift + click) and if I then apply the template, it doesn’t take the newly create page’s title but the title of the journal page which is in the main part of the window.
Here a link to a short video of the bug: WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free