getrawtransaction seems to only work for certain transactions
getrawtransaction is only guaranteed to work for mempool transactions, unless you're running with the -txindex command line flag, or txindex=1 in your bitcoin.conf file.

In practice it works for all transactions that have at least one unspent output remaining, but it's relatively slow, and functionality that may be removed at some point.