Some may ask, "Why is this question important?" It's importance depends on how you define generation. If generation is based on a systems power and specs then it's not an important question, because it's obvious which systems have similar specs. On the other hand if you define generation by which systems are competing, then it is an important question.
The PS5 will launch later this year, and then both the PS5 and PS4 will be on the market at the same time. Will these systems be competing? No, not really. They are not in the same generation. A PS5 customer next year will want to play the latest games at home, the games showed off at Sony's recent presentation. A PS4 customer next year will be looking for a home system that is a value, a cheap system with a huge library of older games. Even though they are both home systems, they aren't competing because they are in different generations. PS4 was competing with the Wii U though. Those systems were in the same generation.
So the key question is, "Will the PS5 be competing with the Switch?" A person who wants to play the lastest games at home might buy the PS5. This same person also might buy a Switch. Animal Crossing: New Horizons, Pokemon Sw/Sh, and Smash Bros Ultimate are also the latest games. You can play all of these games by hooking your Switch up to a TV. The two systems will be competing, because they are both the latest home system. Sure, Switch is portable too, but Switch can easily appeal to someone who only wants to play a home system. Since both PS5 and Switch will be the latest home systems, then they will be competing.
I think what is throwing people is that the Switch seems so different. Several years ago a person might have said, "Blockbuster and Netflix aren't competing because they are just so different. Netflix isn't even a store. It just rents movies through the mail. Blockbuster is in the video store market, and Netflix is in the video by mail market." Fast forward a few years and it's R.I.P. Blockbuster. They were always competing, because what customers wanted was to watch videos at home. Both were providing this same service, but they approached it in very different ways.
Switch and PS5 are both going to be the latest home console system for their respective companies. They both are making an appeal to home console gamers, but they are coming at it from two very different ways. Customers are still going to see them as fulfilling the same role, just like they saw Blockbuster and Netflix as fulfilling the same role.
Because Switch and PS5 are the latest home systems for their two respective companies, they are in the same generation.