This is one of the many confusions that new students to physics face, as many of the first examples of objects on inclines do involve $N=mg\cos\theta$, so students get used to using that and forget why we can even say this in the first place.
Newton's second law is a vector equation that says the net force acting on an object is proportional to the acceleration it undergoes at any point in time
$$\sum\mathbf F=m\mathbf a$$
We can break our vectors into components, and Newton's second law holds for each component. For example, we can choose horizontal and vertical
Or for objects on an incline we can choose parallel and perpendicular to the incline
No choice of components is incorrect for a given system, yet certain components are better for certain systems. Typically, we choose the components so that one lies along the acceleration and the other is perpendicular to the acceleration. A good example is your typical problems of a block sliding down an incline. The acceleration is completely along the incline, so $a_\bot=0$ and Newton's second law tells us
$$\sum F_\bot=N_\bot+w_\bot=N-mg\cos\theta=0\to N=mg\cos\theta$$
However, for the banked curve this is not the case. The acceleration has a component perpendicular to the incline, so now $a_\bot\neq0$ and we have
$$N-mg\cos\theta=ma_\bot\neq0\to N\neq mg\cos\theta$$
For the frictionless banked curve it is not incorrect to still use components parallel and perpendicular to the incline, but the acceleration has components in both of these directions, so it gets messy. Instead if the object maintains its same height on the banked curve to undergo uniform circular motion, the acceleration is completely horizontal. Therefore, we choose horizontal and vertical components where $a_y=0$. Newton's second law then tells us
$$\sum F_y=N_y+w_y=N\cos\theta-mg=0\to N\cos\theta=mg$$
This is an important thing to learn. The fact that the mass is on an inclined surface does not determine what the normal force is. The acceleration must also be considered. In general the normal force is a very tricky force. It is essentially equal to what it needs to be in order to constrain the motion of the system accordingly. To see how tricky it can be, look at a more general case of the object on the banked curve.