It sounds like you have a sort order specified in Portal setup to arrange your portal records in a particular order. Calculations such as List will ignore such sort orders and use the sort order options specified at the relationship level instead.
Open portal setup and figure out the specified sort order unless this is obvious to you without checking. Then go to Manage | Database | Relationships, find the two table occurrences for layout and portal and double click the relationship line that links them. In the dialog that appears, click the sort button on the portal table's side and specify the same sort order that you have specified in portal setup.
PS: An alternative approach that leaves your current sort order settings unchanged would be to replace the list function with an ExecuteSQL function call that uses the ORDER BY clause to specify the desired sort order.
Thanks for the help. I have no sort order specified in the portal (the sort box is unchecked). In the relationship the sort box is also unchecked. GIven this should I create a sort within both areas and make them match?
If there is no sort order specified, the order returned by the List function should match. That makes me wonder if you checked in the correct place in Manage | Database | Relationships.
I doubt that there is any need to specify a sort order for both the portal and the relationship. If you specify a sort order in the relationship, it will also be the order in the portal unless you specify a different sort order in portal setup.