I don’t think the model is clipping the bounding box predictions, as they should be created in this linear layer.
If I run the detection tutorial 2 on Colab I also get predictions outside the 300x300 range by adding this at the end of the notebook:
 import torch.nn.functional as F
img = img.unsqueeze(0)
img = F.interpolate(img, (500, 500))
img = img.squeeze(0)
with torch.no_grad():
    prediction = model([img.to(device)])
prediction[0]['boxes']
> tensor([[104.4511,  59.9262, 339.6740, 466.1226],
          [474.9314,  37.3134, 497.4988, 105.6687]], device='cuda:0')

img = img.unsqueeze(0)
img = F.interpolate(img, (1000, 1000))
img = img.squeeze(0)
with torch.no_grad():
    prediction = model([img.to(device)])
print(prediction[0]['boxes'])
> tensor([[207.8041, 118.8091, 676.5738, 933.9277]], device='cuda:0')