As a preamble, the three basic requirements for a claimed invention is that it must be novel, non-obvious and useful in order to receive a patent. These three requirements can be applied to your two scenarios to provide an answer.
Do I have any grounds to get a patent for my invention [that has the same elements, processes and functionality]?
Please note WIPO application is just a publication and not granted patent. if its get grant in US with same claim below situations can be made.
For US granted patents:-
In accordance of 35 U.S.C. § 271(a):-
...whoever without authority makes, uses, offers to sell, or sells any
patented invention, within the United States or imports into the