Ignore everything above, it appears to be a mis-configured cluster. Similar thing was happening with node.js sdk, so I went to look at some documents in detail and saw a bunch of errors.
Deleted and re-created the cluster.
The above code works now.
Edit:
Is this a result of stopping/starting docker containers and having data corruption? Does docker shut down couchbase gracefully?