I was going to bond the frame to the roof using Black Jack roof cement.
That looks more like it's for repairs like a bitumen in a tin, rather than a fixing / bonding compound.
To stop the thing wandering off (theft / in the wind) you'll need to fix it to something mechanically. You could create upstands then bolt them to the existing the roof surface (possibly ply over a wood structure), then fix the frame in to those. Could just be a block of treated or hardwood wrapped in roofing felt. That cement would be useful to seal it, both to the existing roof surface and where you bolt something to it.
I'm just very wary of compromising the membrane, hence thinking of bonding to it.
However, the external wall does continue above the level of the roof, so I could drill into that to fix the frame, then waterproof the holes using some sort of sealant.
That looks more like it's for repairs like a bitumen in a tin, rather than a fixing / bonding compound.
To stop the thing wandering off (theft / in the wind) you'll need to fix it to something mechanically. You could create upstands then bolt them to the existing the roof surface (possibly ply over a wood structure), then fix the frame in to those. Could just be a block of treated or hardwood wrapped in roofing felt. That cement would be useful to seal it, both to the existing roof surface and where you bolt something to it.