A four-storey multi-million dollar apartment project in Dalkeith has failed to get the green light for the second time.