"There is an apparently new iOS 18 security feature that reboots iPhones that haven’t been unlocked in a few days, frustrating police by making it harder to break into suspects’ iPhones
…
Apple added “inactivity reboot” code in iOS 18.1 that triggers iPhones to restart after they’ve been locked for four days"
Yeah, it will wipe if it’s locked. It wipes as soon as it gets the request from cloud. So immediately if it’s online, or if it’s unable to reach the internet, it wipes once it connects to a cellular or wifi network.