People love using the term "hacked" to explain any little problem with devices (people watch too much TV and think it takes 20 seconds to hack anything). Your iPhone is not "hacked". Even the FBI couldn't hack an iPhone. You iPhone could only be hacked by either some higher entity of if you have one that is jailbroken.
As I said, Apple used to have something explaining that message in its documentation. I looked at the document and it was gone. I then tried Apple's search feature but it does not work with my Firefox browser and my Safari version is too old and ironically is the worst performer when it comes to Apple's own pages. I then did a web search for that phrase and Google which typically returns a million hits only turned up a handful, some of which were posts by me made years ago referring other users to that support page.
I think if you have changed the passcode then that should be okay for a while.
Check Settings > General > VPN & Device Management to make sure there isn't a profile there.