Overriding ansible.cfg with extra vars

I define a custom ansible.cfg, and export it as below in the

export ANSIBLE_CONFIG="../aws_ansible.cfg"

when I run it, this is picked up but when I pass the inventory as an arg, it fails to recognize the arg or take precedence although there is no inventory specified in the aws_ansible.cfg.

 export ANSIBLE_CONFIG=../aws_ansible.cfg
 ansible-playbook demo.yml -i ./inventories/dev1 --verbose
 Using /projects/demo/aws_ansible.cfg as config file 

If I specify the inventory within aws_ansible.cfg it would work, but I would like to pass it as an argument.

Please advice if also extra-vars would take precedence over what are specified in aws_ansible.cfg

I'm not sure i can answer your question because it seems based on a
misconception extra vars are variables, the config file does not use
variables, these are not equivalent things.

That said, there are some configuration items (mostly connection
related) that are overridable via a variable, it doesn't matter where
the variable came from, just that it exists.