I think the term for this is "location transparency" and it tends not to work well in practice. A local function call and a RPC call over a network have very different performance characteristics and failure modes; trying to abstract away the differences can be a bad scene.
A previous journey down this road: https://en.wikipedia.org/wiki/Common_Object_Request_Broker_A...