Pycharm doesn't use the environment variables settings defined in the UI (https://youtrack.jetbrains.com/issue/PY-38367#focus=Comments-27-3904155.0-0), so the workaround is creating a .env file in the base dir of the project with the variables. For example:
UID:${UID}
GID:${GID}