Why does main breaker trips before the smaller one?
Shouldn't the smaller 20A culprit go first?

Imagine you have 15A load on each of your 20A circuits. None of those 20A breakers would trip off because 15 is less than 20.
However the total load is 6x15 = 90A. That would overload your main 63A breaker.
The reason for this discrepancy is that home-owners normally don't run all their circuits at full capacity simultaneously. This is referred to as load diversity. Your local code/regulations will specify the &quot;diversity calculations&quot; (or equivalent) that are used to decide the ratings of the various breakers and the wire sizes etc.

Note that there are several other complications you may need to take into account.
Thermal &amp; Magnetic Overcurrent Protection
Breakers actually have at least two different mechanisms: Firstly a slow &quot;thermal&quot; one that will trip for small overloads (e.g. 40A on a 20A breaker) to prevent wires in the wall overheating. This can take many seconds or minutes to trip-off. Secondly a fast &quot;magnetic&quot; mechanism that quickly trips for short circuits (e.g. preventing 1000A flowing through wires rated 20A). Your main 63A  breaker might be faster than your 20A breaker.
Inrush current, Transient overloads
When you first turn on a large load, some kinds of appliance can draw a very high load for the first few milliseconds. This is sometimes called the &quot;inrush current&quot;. It is normal and you don't want your breakers to trip for this. Therefore breakers have ratings that specify how fast they react and how tolerant they are of transient overloads. Your main breaker could have a different rating to your 20A breakers.
Ground leakage detection
Your main panel may also have GFI/RCD protection that trips in case of earth/ground current leakage. If your 20A breakers don't include this feature, they might not trip before the main GFCI/RCD trips. In the UK a normal thermal+magnetic breaker is called an MCB (Miniature Circuit Breaker), a breaker with earth-leakage detection is called an RCBO (Residual Current Breaker with Overload protection). Other countries have other names.
Arc detection
Then there is AFCI - designed to cut off a circuit if an arc-fault is detected. This is where a normal current is flowing but, for example, dirty contacts in a switch or outlet are causing sparking that is eroding the metal contacts and creating heat. The sparks and heat may eventually ignite a fire even though there is no current overload. Again your 20A breakers might not include this feature but some device elsewhere might.


Is it broken and should I replace it?

It might be but that isn't the first thing you should check.
Generally when a breaker trips, you should suspect a fault in an appliance, in an outlet/socket or in some wiring. You need to find out if any of those are the cause.
If you suspect that substantially more than 20A is flowing through a 20A breaker without it tripping, you could use a clamp meter to measure the actual current. You could instead replace the breaker as a diagnostic measure, but don't be surprised if the problem persists.

Useful references

Circuit breaker trip timing