Welcome to the forum! Are you looking at buying new or used? What size of boat are you considering? Is it just you or with a partner, family, crew?
You asked specifically about Oceanis and Sun Odyssey. One difference between these boats is the Sun Odysseys are commonly used as charter boats and get used pretty hard for the first several years of their lives which can drop the value. A lot of these boats still have a lot of life left in them so can be a good deal. A friend bought a First 40 from a charter fleet in Turkey because it was such a great deal. I think it was just an excuse to sail across the Med and the Atlantic
Used boat prices do somewhat reflect the initial cost but often are more driven by level of maintenance. Honestly, I just had a quick look at YachtWorld and I don't see a huge price difference between these lines, but maybe you are looking at specific models.
3 years is a pretty steep curve to get ready for a round the world cruise, but is certainly doable if your are determined and focused. Getting a boat ready for extended offshore cruising is a lot of work and so is getting to know the boat. There was a family near here years ago that decided to set off and sail around the world. The father knew a bit about sailing but was not an experienced sailor, the rest of the family knew very little at first. They bought a small boat (around 22 feet), sailed that for a couple of years, then bought a 40 foot steel boat, fixed it up for a year then set off. They had fantastic adventures and made it back safe and sound.
If you are new to sailing, think about getting a smaller boat to get your feet wet. Something you can sleep on, learn to sail, dock, navigate. Then trade up in a couple years, spend a year or so setting up the bigger boat, getting to know it, before you set off.