Doh!
I forgot to add the entity to the database! Should have been:
// now add the REAL raster image reference
RasterImage rasterRef = new RasterImage();
rasterRef.ImageDefId = rasterDef.ObjectId;
Autodesk.AutoCAD.DatabaseServices.ObjectId testRefID = rasterRef.ObjectId;
BlockTable bt = (BlockTable)tm.GetObject(db.BlockTableId, OpenMode.ForRead, false);
BlockTableRecord btr = (BlockTableRecord)tm.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite, false);
btr.AppendEntity(rasterRef);
tm.AddNewlyCreatedDBObject(rasterRef, true);
testRefID = rasterRef.ObjectId;