Adding a Thunderbolt dock will not increase the number of supported displays. Those docks repackage the Mac’s hardware-supported video outputs. They do not add new ones.
In addition, because of the extreme bandwidth requirements for 5K displays like the Apple Studio Display, the rule of thumb has been that you can only attach one such display to a particular Thunderbolt 3 or 4 host port or dock. Going by those rules, you would need to use all three Thunderbolt ports on a MBP with a Max chip to attach three 27” 5K Apple Studio Displays.
Thunderbolt 5 has more bandwidth than Thunderbolt 3 and 4, so it seems possible that if you used a Thunderbolt 5 dock with a M4 Max MBP, that you might be able to hang two or three 5K displays off a TB5 dock that had several downstream TB ports. But this is bleeding edge and there is not much experience with what the rules are here, yet.