Yes, you must be on a private network. Next, what version of Windows are you using? Third, are you using a laptop or desktop PC? I have found you cannot screen project your computer if it's a desktop PC that doesn't have a wireless network adapter. Windows uses Miracast to connect to a Roku, and Miracast requires a wireless network adaptor on the computer, even if it's connected to a wired network.
For whatever reason, I have been completely unsuccessful connecting my Windows 11 laptop to any of my Roku devices. The computer sees the Roku and attempts to connect, but the connection fails and it goes back to the main screen. I just tried a laptop with Windows 10, and it connected just fine. But not with the Windows 11 computer.