The Machine will not be able to easily go to court in any jurisdiction and fight for its own ownership. If the machine is producing any real value, human lawyers will untangle the mess and a human will take ownership.
Whilst there's no reason a machine couldn't be a legal person, in the sense that the sentence describes a possible future, that future is not near, and it will take more than a competent robolawyer to bring it about.