I can't help you -- but I can add my sympathy and comment on the dismal state of wood wall framing in Archicad.
Using the wall accessory tool you can lay out wall framing and then get a cut count using the standard component list schedule. You must use that schedule because wall framing in Archicad is a object and the wall studs are reported as components. This also makes it impossible to edit the wall object outside of some standard settings.
Unfortunately , The wall accessory tool in 22 is so buggy as to be unusable now - Previous versions worked -- somewhat. A effort was made to fix it in 22 and they just made it worse!!
There are some workaround -- mostly unacceptable:
You could manually draw the wall framing using beams , then copy,paste,edit. Then the interactive schedules will report accurately.
Could use a expression to roughly calculate the number of studs based on length as you are doing now but it would be done automatically. A option property could add the number of corner studs based on a selection type. This would not allow for windows, headers and doors though - as is your case.
Use a web based wall framing calculator (blocklayer.com) to calculate the same. Same problem as above
Buy the $6000 and $800+ yearly add-on tool from ArchiFrame.
The real only solution is for Archicad to fix this embarrassment. Been reported numerous times!!!
Gerry
Windows 11 - Visual Studio 2022; ArchiCAD 27