Directory and sofia profiles are not the same thing.
Sofia profiles are where you are listening for SIP packets on a port of an IP. Directory contains users on your system.
If you are trying to dial a user then the dialstring syntax is "user/1000". It will expand using their dial-string param defined in the directory and usually call them via the profile they registered to.
"sofia/profile/$profilename/$number@$ip" is a dialstring to send a call out from an IP:port (the profile) to another IP which doesn't require them registering to you. Your error suggests you're trying this.
The vanilla sample configuration file uses names such as "internal" and "external" for sofia profiles and names such as "1000" "1001" etc for users.