A fallback method for when the Share API is not available has been implemented for the Share action in the MORE action sheet in the device item (eb69826), but it has not in the permissions modal public link share button.
After opening a device's action sheet, when clicked on a button, sometimes another action sheet appears, that seems to have been there before dismissing the first sheet, which references an undefined device.
There is no known reason for this behaviour, and no similarities have been found between cases, it just seems to show up randomly.