Sum is one of two standard methods that total related records. A summary field defined in the related table can also return the same total.
If either of these methods fail to return the correct total, you would need to use a relationship that correctly matches to the records you want to total. You don't indicate that either of these portals are filtered, but sum ignores any portal filtering. A Summary field from the portal table, on the other hand can show a total that relfects a portal filter if you put it inside a one row portal with the exact same portal filter expression.
Those are general comments as there are details missing that I would need to know in order to provide more detailed suggestions.
On a layout i have a portal to the floor and the frames table.
On what table occurrence is the layout based? How is it related to the table occurrences of the two portals?
With a global field i select a floor in the portal which displays related frames for that floor in the frames table
There is more than one way to do that. How exactly did you set that up? If this is global field used with a portal filter, see my comments about Sum and filtered portals at the beginning of this post.