As previous advice goes, its probably reasonably safe if you are dealing with a reputable estate agent. I dealt with Sherwoods and they acted honourably in the transaction which is more than can be said for the developer DAMAC. The good agents are aware that eventually people sell their apartments or possibly buy more, and professional service will win them more fees in the long term. Although we all hate to pay those fees, they are fairly insignificant in the whole transaction.
I'm not sure that buying direct off a developer is always a good idea. With RERA getting its act together this should become safer but they are not yet implementing fully the Escrow laws. Yes, developers often have apartments available for sale long after they are 'sold out' but my experience is that these are offered at well above the general market rate. Maybe the price can be negotiated down but when they start at double the market it wasn't too difficult to spot they were trying it on!