Read OUTPUT pin value in Arduino Due
That method only works on AVR based systems.  It exploits a "feature" whereby the IO pin, when in OUTPUT mode, is also in INPUT mode at the same time, and reading the pin reads the value that the pin is being driven to by the digitalWrite function.

The same is not true of the Due, which is an ARM based system.  The IO pins function completely differently and the same "feature" cannot be used.

You will have to remember the state of the pin yourself.