This indicates that you allow being within an editing context. The API and internal engine is written in a way that changes the transformations when not at the model’s top level. When in an edit context coordinates in transforms are in world coordinates not in the instance’s local coordinates.
(This has been explained here in this category multiple times.)
So you may be better off closing all edit contexts before your code does what it does.
model.close_active until model.active_entities == model.entities
EDIT: I see you’ve already been told this by Julia …