What to do if app lock doesn't work?

The app lock function for my phone isn't working. I have a Huawei p-smart 2019. When I lock an app, for example Playstore, I sometimes get the app lock screen and sometimes I don't. But when I close the app completely(while on the app lock screen) and then open it again I am able to open it without entering the pin code. Any way to fix this?