user100550: I wanted to replicate the bad-txns-vout-negative error scenario. I tried the following but getting 'Amount out of range' only:
Here is the command i tried:
bitcoin-cli -named createrawtransaction inputs="[{\"txid\":\"af7cc9204d0ab7d52f66a5dacb79b77c34c90013e3288a391557ee8e07c3c307\",\"vout\":"0"}]" outputs="{\"data\": \"6e636861696e20626974636f696e207361746f73686920766973696f6e\",\"myTmAe67rCuJU5X1fqKiEYohb53TEQrxP3\": 6.249996,\"mt8QSx6m6Fwqt8zMVcji16UiVYS8xYRwFi\": -0.001000}"
error code: -3
error message:
Amount out of range


user101498: The createrawtransaction command will do a sanity check of the arguments and return the Amount out of range error if the value is not >= 0 and <= 21000000 * 10e7, so that you don't shoot yourself in the foot.
You need to craft the invalid on your own, you can see an example of precisely what you are trying to achieve in the functional test suite (which uses python-bitcoinlib).

100550: <p>I wanted to replicate the <code>bad-txns-vout-negative error</code> scenario. I tried the following but getting 'Amount out of range' only:</p>
<p>Here is the command i tried:</p>
<pre><code>bitcoin-cli -named createrawtransaction inputs=&quot;[{\&quot;txid\&quot;:\&quot;af7cc9204d0ab7d52f66a5dacb79b77c34c90013e3288a391557ee8e07c3c307\&quot;,\&quot;vout\&quot;:&quot;0&quot;}]&quot; outputs=&quot;{\&quot;data\&quot;: \&quot;6e636861696e20626974636f696e207361746f73686920766973696f6e\&quot;,\&quot;myTmAe67rCuJU5X1fqKiEYohb53TEQrxP3\&quot;: 6.249996,\&quot;mt8QSx6m6Fwqt8zMVcji16UiVYS8xYRwFi\&quot;: -0.001000}&quot;
error code: -3
error message:
Amount out of range
</code></pre>
 101498: <p>The <code>createrawtransaction</code> command will do a sanity check of the arguments and return the <code>Amount out of range</code> error <a href="https://github.com/bitcoin/bitcoin/blob/a2a250c7d07bcb80cefca9dd4a7ce57f41291334/src/amount.h#L26" rel="nofollow noreferrer">if the value is not <code>&gt;= 0</code> and <code>&lt;= 21000000 * 10e7</code></a>, so that you don't shoot yourself in the foot.</p>
<p>You need to craft the invalid on your own, you can see <a href="https://github.com/bitcoin/bitcoin/blob/a2a250c7d07bcb80cefca9dd4a7ce57f41291334/test/functional/data/invalid_txs.py#L176" rel="nofollow noreferrer">an example of precisely what you are trying to achieve in the functional test suite</a> (which uses python-bitcoinlib).</p>
