Under which circumstances (if ever) should a prospective post-doc apply for a position advertised for a PhD student? Many academic positions are advertised for PhD students. Does it make sense to apply for such a position even if you already have a PhD, in the hope that they might also consider a post-doc instead? Why would the hiring institution not want a post-doc instead of a PhD student? Why would a prospective post-doc not want such a position?
In case somebody wonders why I'm asking:

Often, there are many more projects advertised for prospective PhD students than for prospective post-docs.
Many of the projects seem to be scientifically challenging enough to be interesting also for a post-doc, especially if one is switching fields or completing the project in a shorter time frame.
I cannot see why institutions would be opposed to hiring post-docs instead of PhD students, considering the much higher qualification they bring. I can imagine that there are some limitations attached to funding, though.

For context, I am in an engineering / computer science field in Europe, where PhD and post-doc positions offer comparable salaries.
While it might sometimes be possible to convert the funding from a PhD to a postdoc position, in general I don't think it's a good idea to apply as a postdoc for a PhD position. That being said, you can always contact the PI and ask whether they would have another position for a postdoc.


Often, there are many more projects advertised for prospective PhD students than for prospective post-docs.


This is due to several reasons:

First not every PhD student continues as a postdoc: a lot of them go to industry, some of them quit or fail... and some of them achieve a mediocre PhD which doesn't allow them to get a postdoc job. So mathematically there must be more PhD positions than postdoc positions: if say only 20% of PhDs continue as postdocs, there must be roughly 5 times more PhD positions offered than postdoc ones.
Universities have a duty to teach students, they don't have a duty to hire temporary research staff. The number of PhD students taught is an important target indicator for an institution, whereas the number of postdocs is more a result of their success at grant applications.



Many of the projects seem to be scientifically challenging enough to be interesting also for a post-doc, especially if one is switching fields or completing the project in a shorter time frame.
I cannot see why institutions would be opposed to hiring post-docs instead of PhD students, considering the much higher qualification they bring. I can imagine that there are some limitations attached to funding, though.


I've heard the very vague estimation that one year of postdoc is equivalent to 3 years of PhD in terms of research productivity (incidentally, they are often paid around 3 times more in countries where the PhD is a grant). There's some truth to the idea that a postdoc can do the same job as a PhD faster.
However there are also important differences which can make a PI choose a PhD rather than a postdoc:

a PhD topic can be more prospective and evolve over time.
the PI might want the PhD to test their own research ideas, so they want to supervise the work closely. On the contrary, a postdoc is usually more independent.
supervising PhDs is a must to advance their career.
co-supervising a PhD student is a common way to start a collaboration with a colleague, whereas a postdoc doesn't need much supervision (if any).

It's important to understand that universities are not like companies, they are not looking for the best quality/price ratio for a task. The goal of funding a PhD is not only to answer a research question, it's also to teach somebody how to do research so that they can contribute to society later. This is why the main reason for an institution to hire PhD students is simply that it's an essential part of their mission, that's why they receive public money. This is also why there are indeed very often limitations on the funding, simply because a lot of PhD funding comes from national or international programs meant to increase research capacity by training researchers.