I am trying to write a macro dbgassert similar to the standard assert. In addition to what assert does, I want to dbgassert
You're assuming that assert is implemented by calling __assert. This may well be how one particular implementation works, but certainly cannot be depended on in general.
Instead, follow the documentation: test your condition and on failure emit diagnostic information to standard error, then call std::abort.