Do you just need the page count, or are you trying to use it as a variable?
Is there a reason you chose to divide the document's parts by placing the content on different layers?
There are several ways to keep the different types of numbers for different parts of the document, and several ways to keep the different parts of the book separate. Have you tried methods other than layers? What were the results?
I think the word "layers" here is a red herring and the OP really means "sections" with different numbering styles. The Last Page Number variable returns the value of whatever logical page number is assigned to the last absolute page rather than the physical page count.
I was thinking about this a bit more after my other post, by the way, and the only thing I could come up with, for use as a variable or marker, in a running footer for example, would be to make a custom text variable with the correct number. You'd have to update that variable manually if you change the page count, but the count itself is always listed in the Pages Panel.