Now as you noticed, it shows you the position where the heading is placed before applying the show rule, and not the position of the place.
I don’t know if that’s a bug or intended, maybe @PgBiel can tell.
But also, what are you trying to achieve? I’m pretty sure show heading: it => place(...) is not a good pattern. If you tell us what you want to do (title page?) maybe we can give you a better way to implement it.
Actually, locate(loc => ...) (using locate as a means of obtaining the current location) is deprecated. Using locate(selector) to obtain the location of something else was added in Typst 0.11 together with context and is not deprecated, being encouraged if that is the purpose of the usage.
I’m not sure, but either way it seems ambiguous. I’d recommend not using a show rule for this and using a query which unambiguously matches something inside place, e.g. by adding a label.
#show heading: it => place(top, float: true, [#it <a>])
= Title
#context query(<a>)
Here the query returns nothing for some reason (and I guess it might still give the wrong location if it did work). But it works when I replace it with it.body. I think that’ll do for my use case, I’ll just have to recreate the numbering manually.
The it in this case was already visited by Typst (since you are in its show rule) and will not be considered further. That’s kind of a subtle edge case.