The legality of retaining walls, is dependent on the required engineering.
See information provided on this link.
https://retainingwallsupplies.com.au/legalities-of-building-retaining-walls-in-australia-what-you-need-to-know/
Any wall over 1000mm high will legally require engineering, but lower walls must be suitably built to accommodate the loads placed on them.
The wall photographed above was only 3 sleepers high, so approx. 600mm, but the wall was found to be leaning inward by 160mm over this height, so it was definitely not adequate.
The link provided below is regarding the safety factor built into retainer wall design.
https://australiangeomechanics.org/papers/factor-of-safety-in-as4678-earth-retaining-structures/
When looking at retaining walls during a pre-purchase inspection, it's important for the purchaser to understand if they appear stable or if there are design issues.
Often, however, these issues cannot be seen, as the wall may have been recently constructed and yet to fail.
Remember, rebuilding someone else's poorly built job will be expensive due to the confined space, causing difficulty of access with machinery.
Understanding the costs involved really requires multiple quotes.
You may need to get a soil report done and pay for engineering, or choose the smart path. Have the job done by a licensed tradesman through a reputable retainer wall company, so you have a guarantee on the wall quality.