That shouldn’t make any difference. It’s hierarchical. If it’s “just code” the droid should be physically incapable of disobeying its core programming, shutting down if necessary. The instruction “do not impersonate a deity” would have a higher priority than “obey your master”.
That 3PO did not...