It looks like you’ve answered your own question
it sounds like that interrupts the authentication process so perhaps you can set Avast to only require a PIN after x minutes? Which would hopefully solve the issue.
If not, it’s worth noting that users who use the Norton app haven’t reported this issue so you could try their app instead, although I appreciate the fact that you might not want to add another app for this…
You might be able to just leave the app unlocked & use guest accounts when you give your phone to others too?