What was your position at the university? I am surprised that a legitimate university missed this. Could they have thought that you were on OPT based on your graduation date?
When you register a business, you are unlikely to be asked about your immigration status. I have found instances of students on F-1 who legitimately had to register as a business to receive payment for services they legitimately rendered (had EAD) as a contractor while on F-1 status pre graduation.
However, while on H-1B you are permitted to own a business but you are not allowed to work for it without proper authorization.

