The Nokia 8 autofocus should not behave like that.
I suggest notify the point of sale and claim the warranty as soon as possible, for a proper hands-on evaluation and repair or replacement.
The procedures vary by location:
http://nokia.com/phones/support - down the page.
I hope you get it sorted out.