When you use sticky positioning, the element needs to be stuck ‘relative’ to another element. That would be the first parent element with relative positioning.
I guess your body element’s positioning isn’t set to relative, meaning the nav bar doesn’t know where to ‘stick’