You are comparing different things, pure manufacturing cost vs selling price. The manufacturing cost does not factor in R&D, business costs, marketing, distribution, cost of delivering products to market, profit etc.
Also, businesses balance costs across many products so if you want to compete in a low-cost market area you need to have a thinner margin which you then subsidise with products that are less price sensitive. The best value Micra will be the base spec £7999 whereas the £12k version with a few options will be much more profitable to Nissan as the extras will only add a few hundred to the build cost but the selling price is £4k more.