Short answer; no.
Long answer: If you're really struggling and still quite early, swapping to Samurai isn't a terrible idea, it has a good stat spread and good starting gear. Elden Ring though, like all Soulsborne games, doesn't really put much empthasis on your class. All it is is your starting stats and gear. A couple bosses in, your starting stats won't matter near as much as how you've been leveling, and you can find the gear Samurai starts with in the starting area, if you really want to use a katana. So feel free to do whatever you want/is fun for you, but I wouldn't bother, personally.