OP, thinking this is a good example of actually attending immigration office for their take on your options.
You are aware of the fact that when divorced your permission of stay is invalidated.
However as you point out... immigration will not be informed.
The reentry permit means that you really need to exit end of Oct and obtain a non B
Hopefully someone with same experience as you are in can provide good advice.
Good luck