Apache and nginx both (not sure about others…) can serve multiple sites from the same IP based on the host name that is used to connect and request the file(s).
But when you access the server via the IP address, there must be a virtual host defined to service the name used (the IP). The fact that the server is generating an error indicates that there is something “wrong” on the server’s config - either it isn’t set up to respond to the IP at all, or if it is responding and serving up a PHP or other script that script has issues of some type.