Why couldn't I trade Pokemon on my DSi XL?
If you want to play around with internet-enabled games on an old Nintendo DS, DS Lite, DSi or DSi XL today, you'll - perhaps unsurprisingly - run into several issues:
The first issue is actually far less of a problem than it seems; fans have created their own servers which can be used in place of the old official ones, such as Wiimmfi. Issues 2 and 3 are hard to work around without resorting to piracy, but many people still have their old game collections. In any case, a dedicated retro gamer can find a way to get the games.
The last issue is what I was really motivated to look into because I personally ran into the issue when the DSi XL was launched. What was the reason I couldn't go online with Pokemon Platinum back then? 
DS WiFi connectivity has been an issue for a long time, even right back when the consoles were new. It's a simple fact that the DS and DS Lite have limited support for modern WiFi; to get online with a DS or DS Lite, you need one of the following:
None of these options are good. Running old unsupported versions of Windows is obviously a bad idea. Open networks aren't great either. That leaves WEP, but unfortunately WEP is so completely broken that it's basically equivalent to running an open network.
These frailties mean that the DS and DS Lite are physically incapable of connecting to a secure modern WiFi network; put another way, to go online with those consoles you must put yourself at risk. Even if you were willing to take the risk with WEP (which I'm absolutely not!), many modern routers won't allow users to configure WEP networks any more for security reasons.
On the face of it, the DSi and DSi XL solved this problem; both have "Advanced Settings" in their internet connection menus which allow connecting to WPA2 networks. While WPA2 isn't perfect, it's significantly more secure than WEP and is supported by essentially all home access points in use in even today in 2022.
Unfortunately the DSi isn't a solution for all games.
The original DS / DS Lite were some of the last major handheld consoles to ship without updatable firmware. Sure, there's a menu and startup code, but once the game launches on a cartridge, the cartridge is pretty much entirely in control. There really wasn't much software built in to the original DS.
This barebones nature extends to WiFi connections; the code for interacting with hardware doesn't live on the DS itself, but rather it lives inside the game cartridge and is therefore fixed when the game is built. The DS generally didn't have the concept of game "updates" which we see with consoles like the 3DS and Switch. Practically speaking, when a game cartridge was released it was immutable forever.
The core of the issue here might be getting clearer; when the DSi came along with WPA2 support, games that had been released long before the DSi had no idea about the new hardware, and crucially they could never be updated to support the new consoles. 
Disappointed and confused as I was to discover that I couldn't go online with Pokemon Platinum on my DSi XL, I can't really fault Nintendo for the DS's simple firmware. By limiting functionality there's a smaller attack surface, fewer chances for bugs and an easier time checking that all games play the same on all consoles. In the context of the time the simplicity made sense.
I'll admit to being a little surprised, however, to see that while WEP was publicly known to be very broken as early as August 2001, the DS was first released in late 2004. That made the choice to only include WEP seem a little short-sighted to me, but after digging some more I have to be fair to Nintendo; WPA was released only in 2003 and WPA2 was standardised only in the middle of 2004; the timeline for getting either WPA- or WPA2-supporting hardware into the original DS systems may have been impossibly tight, even ignoring hardware costs and other factors.
It may well be the case, then, that the DS along with its catalogue of early internet-enabled games was an victim of unlucky timing - as was I, fumbling and failing to get online with Pokemon.
 I was inspired to investigate DS WiFi after watching some of Modern Vintage Gamer's YouTube videos about how homebrew and how older game consoles worked. I highly recommend taking a look at some of his videos if you find this kind of content interesting!
 Maybe "could never be updated" is a little strong; it's possible to think of ways they might've been updated on the DSi consoles with online "hot" patches via, say, the DSi store. Certainly no such method of updating games was widely used in practice, though.