Hi,
Try to use a transaction end. Which Revit version do you use?
I know in 22 there is a problem with views/boundingbox: