Hello,
this is by design, to prevent exposure of secrets that could be used to gain write access.
There's a closed issue on Azure Functions GitHub related to this problem and roles, but the same logic applies to any role when a ReadOnly lock is placed.
RBAC reader role does not work with Azure Functions
----------
If any reply helped solve your question, please remember to upvote and/or "Accept Answer".
It helps others facing similar issues find the solution.