Bottom navigation bar's awkward position in prototype when using "fix position while scrolling"

Hello, I am new to Figma, in the mockup I am desiging I want to have a bottom navigation bar which position is fixed to the bottom of the screen and it works fine in prototype
However, to make it work in the prototype I had to make set it like this in design:

Is there a way to have such a component placed correctly in both cases and if so, how can I achieve it?

That worked! Thank you very much!