Why does my 3ds XL freezes after I play online for some minutes

So I've bought this used Old 3ds XL off of Vinted and after some days that he would loose connection after a bit, it just started to freeze on me while playing online on Pokémon Y, I've already changed the WiFi Card using one that my old 2ds had. Any solutions? I have a modern router (WiFi 5) and idk if it could be the problem, thanks in advance for every reply

crwdns2934089:0crwdne2934089:0 crwdns2934093:0crwdne2934093:0

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 0
crwdns2934285:0crwdne2934285:0