I'm trying to understand the computational aspect of elliptic curve primality testing (specifically the Atkin-Morain test), and in general, I understand why it works for a prime number.
However, when it comes to composite numbers, I can't understand why not being able to find a suitable discriminant (and hence not being able to use complex multiplication to construct an elliptic curve with an easily calculable number of points) implies that the number n (which we are testing for primality) is therefore composite.
On the wikipedia page, it states that the list of suitable discriminants is {−3, −4, −7, −8, −11, −12, −16, −19, −27, −28, −43, −67, −163}, and that we need to find a D in that list, such that a^{2}+|D|b^{2}=4N. In most of the implementations of the algorithm that I have found online, if we can't find this representation, for any of the discriminants in the list, then the algorithm returns that N is composite.
I don't understand how this implies that N is composite, rather than implying that we have not been able to set up the Atkin-Morain ECPP properly.
You're correct that it doesn't necessarily make $N$ composite just because you happen to not be able to find the proof that $N$ is prime.
This is a pragmatic, not mathematician decision. Some numbers are really hard to tell using this method, and type 1 error (a false positive) is more dangerous than a type 2 error (false negative) and so type 1 error is selected as the default. Thus people choose to falsely return "composite" when the true answer is "I don't know."